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

Stop using datasette.table_metadata() #99

Open
simonw opened this issue Feb 7, 2024 · 1 comment
Open

Stop using datasette.table_metadata() #99

simonw opened this issue Feb 7, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@simonw
Copy link
Owner

simonw commented Feb 7, 2024

Used here:

def introspect_tables(conn, datasette, db_name):
db = sqlite_utils.Database(conn)
table_names = db.table_names()
view_names = db.view_names()
table_metadata = {}
table_namer = Namer("t")
for table in table_names + view_names:
datasette_table_metadata = datasette.table_metadata(
table=table, database=db_name
)
columns = db[table].columns_dict

This was not a documented method and I'm planning to remove it in Datasette 1.0:

@simonw simonw added the enhancement New feature or request label Feb 7, 2024
@simonw
Copy link
Owner Author

simonw commented Feb 7, 2024

After I release 1.0a8 I'm going to update the tests here to test against both 0.x and 1.x - https://github.com/simonw/datasette-graphql/blob/main/.github/workflows/test.yml - as I did with datasette-cluster-map in simonw/datasette-cluster-map@d2c3a2b

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant