Does the AI assistant in DataGrip have knowledge of my db schema
Completed
I asked the AI Assistant (trial) with some help creating a view in my database and I was hoping that, much like all other AI assistants out there like ChatGPT or Claude, it would actually create the SQL for me. But JetBrains AI, running _inside_ my database IDE with full access to my entire database, had no clue. Is this a limitation of the trial version, or did I fail to connec the AI assistant to my database fully?
Please sign in to leave a comment.
You need to attach the database schema to the chat first so the AI Assistant can access it. Please check the Attach database schema section, it provides a detailed explanation with screenshots on how to attach it in DataGrip and other IDEs.
What if we have a large schema? I get this error message when attempting to attach:
Cannot attach schemaAttachment token limit exceededThank you for your inquiry. The AI Assistant in DataGrip can use your database schema as context to provide more relevant responses, but this requires attaching the schema in the AI chat window. When you attach a schema, the assistant "knows" your schema, but this process is subject to a token limit (currently 5000 tokens). The token count depends on the complexity and number of objects in your schema, not just the number of tables.
If your schema is too large or complex, you will see the error message: "Cannot attach schema. Attachment token limit exceeded."
Best regards,
Jetbrains Support Tean
Hi Vladimir, what's the workaround for if the schema is too large/complex for the max token limit?
I would like the AI Assistant to construct SQL queries based on my prompts and my schema.
Hi Greg,
At the moment there is no workaround but larger schemas will be supported in the future.
OK I'll explore other solutions for now. Looking forward to it.