Integrating your database schema augments the precision of the generated SQL queries and simplifies their construction, as the AI recognizes your database schema's tables and columns. This also enhances explanations and optimizations. Here are the various methods to incorporate your database schema, including manually, via CSV, or through any other format.
Go to the Add Data Source page and select your preferred method to import the database schema.
Here are the different import options:
Selecting "Import via CSV" provides you with a SQL query that automatically fetches the necessary table and column names. This method is prompt and straightforward. On the Import via CSV screen, you can:
To fetch the database schema in CSV format:
Finally, click "Add" to complete the process.
It's possible to add your database schema manually using the subsequent format (table name: column name, column name, column name):
users: id, name, email, password, created_at, updated_at posts: id, title, body, created_at, updated_at comments: id, body, user_id, post_id, created_at, updated_at ...
Merely add the necessary tables and columns, input the database name and select the engine type.
Finally, click "Add" to complete the process.
Your database schema can be imported in any desired format. These include JSON, HTML, plain text, or a custom format such as Prisma's schema.prisma (among other ORMs). The only prerequisite is that the database schema must be structured in a way that the AI can understand.
Connecting to your data source will automatically import the database schema. Importing it with the above method is another way to use our service if connecting isn't desired or an option. Connecting to your data sources gives you additional powerful capabilities like running generated queries directly.