How to use databases

Created by Ricard P, Modified on Mon, 16 Jan 2023 at 08:10 AM by Ricard P

How are databases used in DB Sensei?
Databases are great for providing more context to your prompts.

By default, AI doesn't know the structure of your database. By providing a detailed specification of the database structure, we can get more accurate results and AI can use the name of your database columns in the queries.


Importing your database file

Importing a database into DB Sensei is really simple. Just follow these two simple steps:


1. Navigate to the "databases" tab on the left sidebar and click "New database".
2. Select or drag your database schema file into the file input.

Your database will be instantly parsed and translated into tables and columns, ready to be used in your prompts.


How to make a database import file
You should be able to create the import file with any database client you may be using.

As an example, we will be using TablePlus. 


1. In TablePlus, go to the desired database and select all the tables.


2. Then, go to "File > Export > SQL" and select the "Include table structure" checkbox. Don't worry, this won't import any content to DB Sensei, just the table structure without contents.



3. Export and you'll have the file ready to use in DB Sensei.

If you don't use TablePlus, make sure the exported file is something like this:



We need to find the create statements to correctly import the tables and columns.

Contact support If you need more help importing your databases.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select atleast one of the reasons

Feedback sent

We appreciate your effort and will try to fix the article