Hi all -

I see that I can pass a block to the "from" method like so:

            db = Sequel.connect(
                adapter: :postgres, 
                user: ENV['POSTGRES_USER'], 
                password: ENV['POSTGRES_PASS'], 
                host: ENV['POSTGRES_HOST'], 
                port: ENV['POSTGRES_PORT'], 
                database: ENV['POSTGRES_DB'], 
                max_connections: ENV['POSTGRES_MAX_CONNECTIONS']
            )
            contributions = db.from { schema[:table] }

While the name of the table will always be "table", the name of the schema 
changes depending on the tenant in my application. For instance:

contributions = db.from { team_x[:table] }

Is there a way to do this dynamically? I have the name of the schema that I 
want to use as a string that's provided to me in the method that is running 
the above block.

Thanks!

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/d/optout.

Reply via email to