datasette / datasette-build

Build a directory full of files into a SQLite database
Apache License 2.0
13 stars 0 forks source link

Guess or configure primary key #4

Open simonw opened 10 months ago

simonw commented 10 months ago

Part of:

By default, uses id as primary key if that column exists. But you can also configure the primary key in a file called tablename.config.json or tablename.config.yaml (or .yml) which specifies pk: name-of-column.

simonw commented 10 months ago

I implemented the first version of id guessing here: https://github.com/datasette/datasette-build/blob/bb6a4ef885c1fa3c6c9bafae140974293462758f/datasette_build/cli.py#L33-L39