Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

There should be a way to get the schema for a datasource #4897

Open
matt2e opened this issue Mar 18, 2025 · 1 comment
Open

There should be a way to get the schema for a datasource #4897

matt2e opened this issue Mar 18, 2025 · 1 comment
Labels
triage Issue needs triaging

Comments

@matt2e
Copy link
Collaborator

matt2e commented Mar 18, 2025

Basically I want dbmate dump though it looks like we'd also need a db client to calculate it.

We should also expose this to goose to avoid this:

Let me also check the SQL files to see the database schema and queries:
─── shell | developer ──────────────────────────
command: ls -R /Users/mtoohey/Code/ftl/examples/go/mysql/db/mysql/testdb


queries
schema

/Users/mtoohey/Code/ftl/examples/go/mysql/db/mysql/testdb/queries:
queries.sql

/Users/mtoohey/Code/ftl/examples/go/mysql/db/mysql/testdb/schema:
20241103205514_init.sql
20241103205515_init.sql
20241103205516_init.sql
20241103205517_init.sql


Let me check the queries and schema:
─── Read | ftl ─────────────────────────
path: ...


Read contents of /Users/mtoohey/Code/ftl/examples/go/mysql/db/mysql/testdb/queries/queries.sql

─── Read | ftl ──────────────────────────
path: ...


Read contents of /Users/mtoohey/Code/ftl/examples/go/mysql/db/mysql/testdb/schema/20241103205517_init.sql

─── Read | ftl ──────────────────────────
path: ...


Read contents of /Users/mtoohey/Code/ftl/examples/go/mysql/db/mysql/testdb/schema/20241103205516_init.sql

─── Read | ftl ──────────────────────────
path: ...


Read contents of /Users/mtoohey/Code/ftl/examples/go/mysql/db/mysql/testdb/schema/20241103205515_init.sql

─── Read | ftl ──────────────────────────
path: ...


@github-actions github-actions bot added the triage Issue needs triaging label Mar 18, 2025
@stuartwdouglas
Copy link
Collaborator

I think we would also want this to work for prod clusters, which complicates things as I don't think we would want to connect to the DB to do this dump.

One option would be to store it on the database as runtime metadata and just have the provisioner populate it, which would be cool but could start to bloat the schema size for large databases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage Issue needs triaging
Projects
None yet
Development

No branches or pull requests

2 participants