https://pulumi.com logo
#general
Title
# general
b

better-rainbow-14549

04/11/2019, 1:35 PM
tostring() is returning [Object object] instead of encoding it to utf8 as it should
b

brave-salesmen-42327

04/11/2019, 2:49 PM
I had to use toString( 'utf8' ) in a similar situation. Some stackoverflow explanation(s): https://stackoverflow.com/a/12122668
l

lemon-spoon-91807

04/11/2019, 4:44 PM
Pulumi.all is really for dealing with pojo data. Not complex types like buffers. In this case, just await your promise, or do .then on it
Get your Promise<string> and pass that to
.all
👍 1
Let me only if you need more info!
b

better-rainbow-14549

04/11/2019, 4:45 PM
ok i'll try that cheers
i'm currently getting seriously confused trying to write a dynamic provider :S
l

lemon-spoon-91807

04/11/2019, 5:10 PM
hey 🙂
sorry, was walking to work
unfortunately, i'm not an expert on dynamic providers
but maybe i can help depending on what sort of issues you're running into
b

better-rainbow-14549

04/11/2019, 5:11 PM
i think i've just confused myself too much hah
dont worry about it i probably need to read a bit more
but i'm trying to make something that will add/remove db roles by generating an sql script and calling to an outside query executor
what i thought wouldnt be too hard is.. hard
l

lemon-spoon-91807

04/11/2019, 5:12 PM
oh wow...
stepping back, why does that need to be a provider?
b

better-rainbow-14549

04/11/2019, 5:13 PM
i thought the way to do it would be to create a provider that can apply the change, then create a custom resource which could map from params to state
but i started off wanting to make something that would apply database schema changes
by verifying the current schema version and then running an update script
i found a terraform postgres_schema provider but nothing like it for sqlserver
l

lemon-spoon-91807

04/11/2019, 5:14 PM
yeah... i know very litle about this. and the person best qualified is oof currently
b

better-rainbow-14549

04/11/2019, 5:14 PM
i'd like to be able to apply or not apply schema migrations if they're required
l

lemon-spoon-91807

04/11/2019, 5:15 PM
so, first, i can't even say if Providers are the right path forward. but let's say they are.
what issues are you running into?
b

better-rainbow-14549

04/11/2019, 5:15 PM
😄
it seems to sit with an unresolved promise
but also, i see that it's tried to execute with [Object object] as the generated script
and in general i'm not at all sure if i'm going about it the right way
l

lemon-spoon-91807

04/11/2019, 5:47 PM
first, did thestuff about Buffers and .all work out for you?
b

better-rainbow-14549

04/12/2019, 12:20 PM
i got that sorted but i couldnt figure out putting it in the provider methods with a promise
got it all sorted 😄 thanks
l

lemon-spoon-91807

04/15/2019, 5:06 PM
terrific!