home / docs / sections

sections: upgrade_guide:upgrade-guide-v1-sql-queries

This data as json

id page ref title content breadcrumbs references
upgrade_guide:upgrade-guide-v1-sql-queries upgrade_guide upgrade-guide-v1-sql-queries New URL for SQL queries Prior to 1.0a14 the URL for executing a SQL query looked like this: /databasename?sql=select+1 # Or for JSON: /databasename.json?sql=select+1 This endpoint served two purposes: without a ?sql= it would list the tables in the database, but with that option it would return results of a query instead. The URL for executing a SQL query now looks like this: /databasename/-/query?sql=select+1 # Or for JSON: /databasename/-/query.json?sql=select+1 This isn't a breaking change. API calls to the older /databasename?sql=... endpoint will redirect to the new databasename/-/query?sql=... endpoint. Upgrading to the new URL is recommended to avoid the overhead of the additional redirect. ["Upgrade guide", "Datasette 0.X -> 1.0"] []
Powered by Datasette · Queries took 1.083ms