tostring() is returning [Object object] instead of...
# general
b
tostring() is returning [Object object] instead of encoding it to utf8 as it should
b
I had to use toString( 'utf8' ) in a similar situation. Some stackoverflow explanation(s): https://stackoverflow.com/a/12122668
l
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
ok i'll try that cheers
i'm currently getting seriously confused trying to write a dynamic provider :S
l
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
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
oh wow...
stepping back, why does that need to be a provider?
b
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
yeah... i know very litle about this. and the person best qualified is oof currently
b
i'd like to be able to apply or not apply schema migrations if they're required
l
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
😄
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
first, did thestuff about Buffers and .all work out for you?
b
i got that sorted but i couldnt figure out putting it in the provider methods with a promise
got it all sorted 😄 thanks
l
terrific!