Handle single Query Lambda for multiple integrations

My stack is based on sst, single table dynamodb and I have a different AWS Account for developer and environment (dev and prod):

I already have use rockset in prod environment but now I want extend it to all environments.

I would use Query Lambda but I can’t, as shown in the attachment I have a Query Lambda binded to this query which refers to integration of my collegue (mcattaneo).

It could be fine to define parameters on FROM clause in this way I could switch integration based on parameters.
What I can’t do is duplicate query lambda on all stages for obvious maintainability reason.

Actually I’m planing to use only Query specifying Collection and Integration in my application code with rockset sdk.
Do you have some suggestion or found some issue on adopting only Query on Collection?

Hi gmarino,

If I understood correctly, you want the ability to parameterize the workspace and collection?

This can be done by using the TABLE() function like so:

select
    *
from
    table('workspace.collection') t

You can take things one step further by adding a parameter:

from
    table(:collection) t

Hope this helps!

Omar

1 Like

Could do you share the reference on Rockset docs?
I’m not sure to have understand how implement it. The function is not available

You can still use it, it looks like we haven’t added a reference to it on our docs or autocomplete just yet. I’ll leave a note to the documentation team to add a reference to it, thanks for letting me know.

Omar

thank you, it works properly!