Add suporte a MySQL e postgree - #15
Open
antoniocaarvalh wants to merge 2 commits into
Open
antoniocaarvalh wants to merge 2 commits into
antoniocaarvalh wants to merge 2 commits into
Conversation
Adds native schema introspection (information_schema, no Java/SchemaCrawler required) and query execution (psycopg2/pymysql) for PostgreSQL and MySQL, routed via a new db_dialeto/db_config state field. The code-gen prompt now tells the LLM which dialect it's targeting instead of always assuming SQLite. SQLite behavior is unchanged (dialect defaults to sqlite when not specified).
Adds an optional db_url field (e.g. postgresql://user:pass@host:port/db) that, when set, drives schema introspection and query execution through SQLAlchemy instead of the manual db_dialeto/db_config path added earlier. The dialect is read from engine.dialect.name, so the caller only needs to provide one connection string instead of six separate flags/params. This is purely additive: when db_url is not set, behavior is unchanged (same db_dialeto/db_config/db_path path as before).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adicionei suporte a PostgreSQL e MySQL. Criei a introspecção de schema pros dois bancos (via information_schema, sem precisar de Java/SchemaCrawler) e os executores de query (psycopg2 e pymysql), com a mesma validação de segurança de antes (só SELECT/WITH). O prompt do LLM agora sabe qual banco é o alvo, em vez de sempre assumir SQLite (Isso estava me dando problema). Testei tudo local com Postgres 17 e MySQL 8.4, incluindo uma query de exemplo do BIRD que vcfs passaram, e rodei a suíte de testes inteira para ver se quebrava algo do SQLite, e deu tudo certinho. Fiz um docx detalhando mais o processo