Skip to content

Add suporte a MySQL e postgree - #15

Open
antoniocaarvalh wants to merge 2 commits into
gruporaia:mainfrom
antoniocaarvalh:feature/postgres-mysql-support
Open

antoniocaarvalh wants to merge 2 commits into
gruporaia:mainfrom
antoniocaarvalh:feature/postgres-mysql-support

Conversation

@antoniocaarvalh

Copy link
Copy Markdown
Collaborator

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

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).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant