Database metadata for multi-schema databases #2187
leenyburger
started this conversation in
General
Replies: 2 comments 3 replies
-
I think you have to set the schema search path https://www.postgresql.org/docs/current/ddl-schemas.html#DDL-SCHEMAS-PATH |
Beta Was this translation helpful? Give feedback.
0 replies
-
Database#tables on PostgreSQL also supports a :schema option to return all tables in a given schema (by default, it gives you tables in the schema search path): https://sequel.jeremyevans.net/rdoc-adapters/classes/Sequel/Postgres/DatabaseMethods.html#method-i-tables |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
If a database has multiple schemas, how do I build a representation of the database?
Right now I'm using
db.tables
to get a list of tables in the database to compose an abbreviated schema for training an LLM.Where
Running this on a multi schema database, I get just the tables in the first(?) schema?
Full example:

Schema 1
Schema 2
db call
where
db = #<Sequel::Postgres::Database: {:adapter=>"postgres", :host=>"localhost", :database=>"demo", :user=>"", :password=>"", :port=>"5432"}>
Beta Was this translation helpful? Give feedback.
All reactions