home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

214 rows where reactions = "{"total_count": 1, "+1": 1, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0}" sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

Suggested facets: created_at (date), updated_at (date)

user >30

  • simonw 157
  • cldellow 5
  • clausjuhl 3
  • 20after4 2
  • tsibley 2
  • fgregg 2
  • brandonrobertz 2
  • nitinpaultifr 2
  • asg017 2
  • garethr 1
  • frafra 1
  • nkirsch 1
  • harperreed 1
  • eyeseast 1
  • aborruso 1
  • adamwolf 1
  • obra 1
  • ctb 1
  • cadeef 1
  • bgrins 1
  • wragge 1
  • mcarpenter 1
  • mroswell 1
  • Btibert3 1
  • carlmjohnson 1
  • robintw 1
  • UtahDave 1
  • coldclimate 1
  • chrislkeller 1
  • MarkusH 1
  • …

issue >30

  • Escape_fts5_query-hookimplementation does not work with queries to standard tables 4
  • Support column descriptions in metadata.json 3
  • "Stream all rows" is not at all obvious 3
  • Update for Big Sur 3
  • Add GraphQL endpoint 2
  • base_url configuration setting 2
  • Stream all results for arbitrary SQL and canned queries 2
  • bump uvicorn to 0.9.0 to be Python-3.8 friendly 2
  • --cp option for datasette publish and datasette package for shipping additional files and directories 2
  • bpylist.archiver.CircularReference: archive has a cycle with uid(13) 2
  • Redesign default .json format 2
  • Improved (and better documented) support for transactions 2
  • .delete_where() does not auto-commit (unlike .insert() or .upsert()) 2
  • WIP: Add Gmail takeout mbox import 2
  • Feature or Documentation Request: Individual table as home page template 2
  • Better default display of arrays of items 2
  • Document how to send multiple values for "Named parameters" 2
  • JSON export dumps JSON fields as TEXT 2
  • Option for importing CSV data using the SQLite .import mechanism 2
  • Add scientists to target groups 2
  • Make it easier to insert geometries, with documentation and maybe code 2
  • CLI eats my cursor 2
  • SQL query field can't begin by a comment 2
  • Datasette with many and large databases > Memory use 2
  • Upgrade to CodeMirror 6, add SQL autocomplete 2
  • feat: Javascript Plugin API (Custom panels, column menu items with JS actions) 2
  • De-tangling Metadata before Datasette 1.0 2
  • Bump sphinx, furo, blacken-docs dependencies 2
  • Dockerfile should build more recent SQLite with FTS5 and spatialite support 1
  • Package as standalone binary 1
  • …

author_association 4

  • OWNER 147
  • NONE 37
  • CONTRIBUTOR 20
  • MEMBER 10

reactions 1 ✖

  • {"total_count": 1, "+1": 1, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0} · 214 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions issue performed_via_github_app
1846554637 https://github.com/simonw/sqlite-utils/issues/605#issuecomment-1846554637 https://api.github.com/repos/simonw/sqlite-utils/issues/605 IC_kwDOCGYnMM5uEDAN simonw 9599 2023-12-08T05:07:54Z 2023-12-08T05:07:54Z OWNER

Thanks for opening an issue - this should help future Google searchers figure out what's going on here.

Another approach here could be to store large integers as TEXT in SQLite (or even as BLOB).

Both storing as REAL and storing as TEXT/BLOB feel nasty to me, but it looks like SQLite has a hard upper limit of 9223372036854775807 for integers.

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Insert fails with `Error: Python int too large to convert to SQLite INTEGER`; can we use `NUMERIC` here? 2007893839  
1816642044 https://github.com/simonw/datasette/issues/670#issuecomment-1816642044 https://api.github.com/repos/simonw/datasette/issues/670 IC_kwDOBm6k_c5sR8H8 tf13 16142258 2023-11-17T15:32:20Z 2023-11-17T15:32:20Z NONE

Any progress on this? It would be very helpful on my end as well. Thanks!

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Prototoype for Datasette on PostgreSQL 564833696  
1793274350 https://github.com/simonw/sqlite-utils/issues/433#issuecomment-1793274350 https://api.github.com/repos/simonw/sqlite-utils/issues/433 IC_kwDOCGYnMM5q4zHu simonw 9599 2023-11-04T00:46:30Z 2023-11-04T00:46:30Z OWNER

And a GIF of the fix after applying: - #598

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
CLI eats my cursor 1239034903  
1791911093 https://github.com/simonw/datasette/issues/949#issuecomment-1791911093 https://api.github.com/repos/simonw/datasette/issues/949 IC_kwDOBm6k_c5qzmS1 simonw 9599 2023-11-03T05:28:09Z 2023-11-03T05:28:58Z OWNER

Datasette is using that now, see: - #1893

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Try out CodeMirror SQL hints 684961449  
1737906995 https://github.com/simonw/datasette/pull/2155#issuecomment-1737906995 https://api.github.com/repos/simonw/datasette/issues/2155 IC_kwDOBm6k_c5nllsz cadeef 79087 2023-09-27T18:44:02Z 2023-09-27T18:44:02Z NONE

@simonw Any chance we can get this tiny patch merged for an upcoming release?

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Fix hupper.start_reloader entry point 1865572575  
1692182910 https://github.com/simonw/datasette/issues/2143#issuecomment-1692182910 https://api.github.com/repos/simonw/datasette/issues/2143 IC_kwDOBm6k_c5k3Kl- simonw 9599 2023-08-24T18:06:57Z 2023-08-24T18:08:17Z OWNER

The other thing that could work is something like this: bash export AUTH_TOKENS_DB="tokens" datasette \ -s settings.sql_time_limit_ms 1000 \ -s plugins.datasette-auth-tokens.manage_tokens true \ -e plugins.datasette-auth-tokens.manage_tokens_database AUTH_TOKENS_DB So -e is an alternative version of -s which reads from the named environment variable instead of having the value provided directly as the second value in the pair.

I quite like this, because it could replace the really ugly $ENV pattern we have in plugin configuration at the moment: https://docs.datasette.io/en/1.0a4/plugins.html#secret-configuration-values yaml plugins: datasette-auth-github: client_secret: $env: GITHUB_CLIENT_SECRET

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
De-tangling Metadata before Datasette 1.0 1855885427  
1689207309 https://github.com/simonw/datasette/issues/2123#issuecomment-1689207309 https://api.github.com/repos/simonw/datasette/issues/2123 IC_kwDOBm6k_c5kr0IN simonw 9599 2023-08-23T03:07:27Z 2023-08-23T03:07:27Z OWNER

I'm happy to debug and land a patch if it's welcome.

Yes please! What an odd bug.

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
datasette serve when invoked with --reload interprets the serve command as a file 1825007061  
1689198368 https://github.com/simonw/datasette/pull/2148#issuecomment-1689198368 https://api.github.com/repos/simonw/datasette/issues/2148 IC_kwDOBm6k_c5krx8g simonw 9599 2023-08-23T02:57:53Z 2023-08-23T02:57:53Z OWNER

@dependabot rebase

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Bump sphinx, furo, blacken-docs dependencies 1859415334  
1689128911 https://github.com/simonw/datasette/issues/493#issuecomment-1689128911 https://api.github.com/repos/simonw/datasette/issues/493 IC_kwDOBm6k_c5krg_P simonw 9599 2023-08-23T01:29:20Z 2023-08-23T01:29:20Z OWNER

It's going to be called datasette.json and the concept of metadata will be split out separately. See:

  • 2149

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Rename metadata.json to config.json 449886319  
1689127479 https://github.com/simonw/datasette/pull/2148#issuecomment-1689127479 https://api.github.com/repos/simonw/datasette/issues/2148 IC_kwDOBm6k_c5krgo3 simonw 9599 2023-08-23T01:26:53Z 2023-08-23T01:26:53Z OWNER

@dependabot recreate

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Bump sphinx, furo, blacken-docs dependencies 1859415334  
1686683596 https://github.com/simonw/datasette/issues/2145#issuecomment-1686683596 https://api.github.com/repos/simonw/datasette/issues/2145 IC_kwDOBm6k_c5kiL_M simonw 9599 2023-08-21T16:49:12Z 2023-08-21T16:49:12Z OWNER

Suggestion from @asg017 is that we say that if your row has a null primary key you don't get a link to a row page for that row.

Which has some precedent, because our SQL view display doesn't link to row pages at all (since they don't make sense for views): https://latest.datasette.io/fixtures/simple_view

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
If a row has a primary key of `null` various things break 1857234285  
1685263948 https://github.com/simonw/datasette/issues/2143#issuecomment-1685263948 https://api.github.com/repos/simonw/datasette/issues/2143 IC_kwDOBm6k_c5kcxZM dvizard 11784304 2023-08-20T11:50:10Z 2023-08-20T11:50:10Z NONE

This also makes it simple to separate out secrets.

datasette --config settings.yaml --config secrets.yaml --config db-docs.yaml --config db-fixtures.yaml

settings.yaml settings: default_page_size: 10 max_returned_rows: 3000 sql_time_limit_ms": 8000 plugins: datasette-ripgrep: path: /usr/local/lib/python3.11/site-packages

secrets.yaml plugins: datasette-auth-github: client_secret: SUCH_SECRET

db-docs.yaml databases: docs: permissions: create-table: id: editor

db-fixtures.yaml databases: fixtures: tables: no_primary_key: hidden: true queries: neighborhood_search: sql: |- select neighborhood, facet_cities.name, state from facetable join facet_cities on facetable.city_id = facet_cities.id where neighborhood like '%' || :text || '%' order by neighborhood; title: Search neighborhoods description_html: |- <p>This demonstrates <em>basic</em> LIKE search

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
De-tangling Metadata before Datasette 1.0 1855885427  
1672385674 https://github.com/simonw/datasette/issues/2126#issuecomment-1672385674 https://api.github.com/repos/simonw/datasette/issues/2126 IC_kwDOBm6k_c5jrpSK simonw 9599 2023-08-10T01:07:43Z 2023-08-10T01:07:43Z OWNER

What version of Datasette are you running?

That feature was added in Datasette 1.0a2, so if you're on the current stable release you won't have it yet.

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Permissions in metadata.yml / metadata.json 1838266862  
1656696679 https://github.com/dogsheep/dogsheep-photos/pull/31#issuecomment-1656696679 https://api.github.com/repos/dogsheep/dogsheep-photos/issues/31 IC_kwDOD079W85ivy9n coldclimate 319473 2023-07-29T10:10:29Z 2023-07-29T10:10:29Z NONE

+1 to getting this merged down.

For future googlers, I installed by... git clone git@github.com:RhetTbull/dogsheep-photos.git cd dogsheep-photos git checkout update_for_bigsur python setup.py install

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Update for Big Sur 771511344  
1616095810 https://github.com/simonw/datasette/pull/2052#issuecomment-1616095810 https://api.github.com/repos/simonw/datasette/issues/2052 IC_kwDOBm6k_c5gU6pC asg017 15178711 2023-07-01T20:31:31Z 2023-07-01T20:31:31Z CONTRIBUTOR

Just curious, is there a query that can be used to compile this programmatically, or did you identify these through memory?

I just did a github search for user:simonw "def extra_js_urls(" ! Though I'm sure other plugins made by people other than Simon also exist out there https://github.com/search?q=user%3Asimonw+%22def+extra_js_urls%28%22&type=code

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
feat: Javascript Plugin API (Custom panels, column menu items with JS actions) 1651082214  
1613895188 https://github.com/simonw/datasette/issues/2093#issuecomment-1613895188 https://api.github.com/repos/simonw/datasette/issues/2093 IC_kwDOBm6k_c5gMhYU asg017 15178711 2023-06-29T22:51:53Z 2023-06-29T22:51:53Z CONTRIBUTOR

I agree with not liking metadata.json stuff in a datasette.* config file. Editing description of a table/column in a file like datasette.* seems odd to me.

Though since plugin configuration currently lives in metadata.json, I think it should be removed from there and placed in datasette.*, at least for top-level config like datasette-auth-github's config. Keeping metadata.json strictly for documentation/licensing/column units makes sense to me, but anything plugin related should be in some config file, like datasette.*.

And ya, supporting both datasette.* and CLI flags makes a lot of sense to me. Any --setting flag should override anything in datasette.* for easier debugging, with possibly a warning message so people don't get confused. Same with --port and a port defined in datasette.*

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Proposal: Combine settings, metadata, static, etc. into a single `datasette.yaml` File 1781530343  
1613290899 https://github.com/simonw/datasette/pull/2077#issuecomment-1613290899 https://api.github.com/repos/simonw/datasette/issues/2077 IC_kwDOBm6k_c5gKN2T simonw 9599 2023-06-29T14:32:16Z 2023-06-29T14:32:16Z OWNER

@dependabot recreate

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Bump furo from 2023.3.27 to 2023.5.20 1719759468  
1548913065 https://github.com/simonw/sqlite-utils/issues/399#issuecomment-1548913065 https://api.github.com/repos/simonw/sqlite-utils/issues/399 IC_kwDOCGYnMM5cUomp chrislkeller 433780 2023-05-16T03:11:03Z 2023-05-16T03:11:52Z NONE

Using this thread and some other resources I managed to cobble together a couple of sqlite-utils lines to add a geometry column for a table that already has a lat/lng column.

```

add a geometry column

sqlite-utils add-geometry-column [db name] [table name] geometry --type POINT --srid 4326

add a point for each row to geometry column

sqlite-utils --load-extension=spatialite [db name] 'update [table name] SET Geometry=MakePoint(longitude, latitude, 4326);' ```

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Make it easier to insert geometries, with documentation and maybe code 1124731464  
1548617257 https://github.com/simonw/datasette/pull/2052#issuecomment-1548617257 https://api.github.com/repos/simonw/datasette/issues/2052 IC_kwDOBm6k_c5cTgYp cldellow 193185 2023-05-15T21:32:20Z 2023-05-15T21:32:20Z CONTRIBUTOR

Were you picturing that the whole plugin config object could be returned as a promise, or that the individual hooks (like makeColumnActions or makeAboveTablePanelConfigs supported returning a promise of arrays instead only returning plain arrays?

The latter - that you could return a promise of arrays, so it parallels the "await me maybe" pattern in Datasette, where you can return either a value, a callable or an awaitable.

I have a hunch that what you're describing might be achievable without adding Promises to the API with something

Oops, I did a poor job explaining. Yes, this would work - but it requires me to continue to communicate the column names out of band (in order to fetch the facet data per-column before registering my plugin), vs being able to re-use them from the plugin implementation.

This isn't that big of a deal - it'd be a nice ergonomic improvement, but nowhere near as a big of an improvement as having an officially sanctioned way to add stuff to the column menus in the first place.

This could also be layered on in a future commit without breaking v1 users, too, so it's not at all urgent.

especially if those lines are encapsulated by a function we provide (maybe something that's available on the window provided by Datasette as an inline script tag

Ah, this is maybe the the key point. Since it's all hosted inside Datasette, Datasette can provide some arbitrary sugar to make it easier to work with.

My experience with async scripts in JS is that people sometimes don't understand the race conditions inherent to them. If they copy/paste from a tutorial, it does just work. But then they'll delete half the code, and by chance it still works on their machine/Datasette templates, and now someone's headed for an annoying debugging session -- maybe them, maybe someone else who tries to re-use their plugin.

Again, a fairly minor thing, though.

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
feat: Javascript Plugin API (Custom panels, column menu items with JS actions) 1651082214  
1539108140 https://github.com/simonw/sqlite-utils/issues/525#issuecomment-1539108140 https://api.github.com/repos/simonw/sqlite-utils/issues/525 IC_kwDOCGYnMM5bvO0s simonw 9599 2023-05-08T21:59:41Z 2023-05-08T21:59:41Z OWNER

That original example passes against main now.

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Repeated calls to `Table.convert()` fail 1575131737  
1539100300 https://github.com/simonw/sqlite-utils/issues/514#issuecomment-1539100300 https://api.github.com/repos/simonw/sqlite-utils/issues/514 IC_kwDOCGYnMM5bvM6M simonw 9599 2023-05-08T21:50:51Z 2023-05-08T21:50:51Z OWNER

Seeing as sqlite-utils doesn't currently provide mechanisms for adding check constraints like this I'm going to leave this - I'm happy with the fix I put in for the not null constraints.

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
upsert of new row with check constraints fails 1465194249  
1539055393 https://github.com/simonw/sqlite-utils/pull/537#issuecomment-1539055393 https://api.github.com/repos/simonw/sqlite-utils/issues/537 IC_kwDOCGYnMM5bvB8h simonw 9599 2023-05-08T21:10:06Z 2023-05-08T21:10:06Z OWNER

Thanks!

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Support self-referencing FKs in `Table.create` 1665200812  
1539015064 https://github.com/simonw/sqlite-utils/issues/530#issuecomment-1539015064 https://api.github.com/repos/simonw/sqlite-utils/issues/530 IC_kwDOCGYnMM5bu4GY simonw 9599 2023-05-08T20:35:07Z 2023-05-08T20:35:07Z OWNER

Wow, this is a neat feature I didn't know about. Looks like there are a bunch of options:

  • NO ACTION (default)
  • RESTRICT: application is prohibited from deleting a parent key when there exists one or more child keys mapped to it
  • SET NULL: when a parent key is deleted the child key columns of all rows in the child table that mapped to the parent key are set to contain SQL NULL values
  • SET DEFAULT: set a specific default
  • CASCADE: propagates the delete or update operation on the parent key to each dependent child key
{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
add ability to configure "on delete" and "on update" attributes of foreign keys: 1595340692  
1487998788 https://github.com/simonw/datasette/pull/2014#issuecomment-1487998788 https://api.github.com/repos/simonw/datasette/issues/2014 IC_kwDOBm6k_c5YsQ9E simonw 9599 2023-03-29T06:08:23Z 2023-03-29T06:08:23Z OWNER

@dependabot recreate

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Bump black from 22.12.0 to 23.1.0 1566081801  
1444474487 https://github.com/simonw/sqlite-utils/issues/433#issuecomment-1444474487 https://api.github.com/repos/simonw/sqlite-utils/issues/433 IC_kwDOCGYnMM5WGO53 mcarpenter 167893 2023-02-24T20:57:43Z 2023-02-24T22:22:18Z CONTRIBUTOR

I think I see what is happening here, although I haven't quite work out a fix yet. Usually:

  • click.progressbar.render_progress() renders the cursor invisible on each invocation (update of the bar)
  • When the progress bar goes out of scope, the __exit()__ method is invoked, which calls render_finish() to make the cursor re-appear.

(See terminal escape sequences BEFORE_BAR and AFTER_BAR in click).

However the sqlite-utils utils.file_progress context manager wraps click.progressbar and yields an instance of a helper class:

python @contextlib.contextmanager def file_progress(file, silent=False, **kwargs): ... with click.progressbar(length=file_length, **kwargs) as bar: yield UpdateWrapper(file, bar.update)

The yielded UpdateWrapper goes out of scope quickly and click.progressbar.__exit__() is called. The cursor is made un-invisible. Hoewever bar is still live and so when the caller iterates on the yielded wrapper this invokes the bar's update method, calling render_progress(), each time printing the "make cursor invisible" escape code. The progressbar.__exit__ function is not called again, so the cursor doesn't re-appear.

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
CLI eats my cursor 1239034903  
1437671409 https://github.com/simonw/datasette/issues/1258#issuecomment-1437671409 https://api.github.com/repos/simonw/datasette/issues/1258 IC_kwDOBm6k_c5VsR_x brandonrobertz 2670795 2023-02-20T23:39:58Z 2023-02-20T23:39:58Z CONTRIBUTOR

This is pretty annoying for FTS because sqlite throws an error instead of just doing something like returning all or no results. This makes users who are unfamiliar with SQL and Datasette think the canned query page is broken and is a frequent source of confusion.

To anyone dealing with this: My solution is to modify the canned query so that it returns no results which cues people to fill in the blank parameters.

So instead of emails_fts match escape_fts(:search))

My canned queries now look like this:

emails_fts match escape_fts(iif(:search=="", "*", :search))

There are no asterisks in my data so the result is always blank.

Ultimately it would be nice to be able to handle this in the metadata. Either making some named parameters required or setting some default values.

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Allow canned query params to specify default values 828858421  
1425974877 https://github.com/simonw/datasette/issues/2023#issuecomment-1425974877 https://api.github.com/repos/simonw/datasette/issues/2023 IC_kwDOBm6k_c5U_qZd cldellow 193185 2023-02-10T15:32:41Z 2023-02-10T15:32:41Z CONTRIBUTOR

I think this feature was removed in Datasette 0.61 and moved to a plugin. People who want hashed URLs can use the datasette-hashed-urls plugin to achieve the same affect.

It looks like you're trying to disable hashed urls, so I think you can just remove that config setting and things will work.

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Error: Invalid setting 'hash_urls' in settings.json in 0.64.1 1579695809  
1419734229 https://github.com/simonw/sqlite-utils/issues/524#issuecomment-1419734229 https://api.github.com/repos/simonw/sqlite-utils/issues/524 IC_kwDOCGYnMM5Un2zV cldellow 193185 2023-02-06T20:53:28Z 2023-02-06T21:16:29Z NONE

I think it's not currently possible: sqlite-utils requires that it be one of integer, text, float, blob (see code)

IMO, this is a bit of friction and it would be nice if it was more permissive. SQLite permits developers to use any data type when creating a table. For example, this is a perfectly cromulent sqlite session that creates a table with columns of type baz and bar:

``` sqlite> create table foo(column1 baz, column2 bar); sqlite> .schema foo CREATE TABLE foo(column1 baz, column2 bar); sqlite> select * from pragma_table_info('foo'); cid name type notnull dflt_value pk


0 column1 baz 0 0
1 column2 bar 0 0
```

The idea is that the application developer will know what meaning to ascribe to those types. For example, I'm working on a plugin to Datasette. Dates are tricky to handle. If you have some existing rows, you can look at the values in them to know how a user is serializing the dates -- as an ISO 8601 string? An RFC 3339 string? With millisecond precision? With timezone offset? But if you don't yet have any rows, you have to guess. If the column is of type TEXT, you don't even know that it's meant to hold a date! In this case, my plugin will look to see if the column is of type DATE or DATETIME, and assume a certain representation when writing.

Perhaps there is an argument that sqlite-utils is trying to conform to SQLite's strict mode, and that is why it limits the choices. In strict mode, SQLite requires that the data type be one of INT, INTEGER, REAL, TEXT, BLOB, ANY. But that can't be the case -- sqlite-utils supports FLOAT, which is not one of the valid types in strict mode, and it rejects INT, REAL and ANY, which are valid.

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Transformation type `--type DATETIME` 1572766460  
1404070841 https://github.com/simonw/sqlite-utils/pull/203#issuecomment-1404070841 https://api.github.com/repos/simonw/sqlite-utils/issues/203 IC_kwDOCGYnMM5TsGu5 fgregg 536941 2023-01-25T18:47:18Z 2023-01-25T18:47:18Z CONTRIBUTOR

i'll adopt this PR to make the changes @simonw suggested https://github.com/simonw/sqlite-utils/pull/203#issuecomment-753567932

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
changes to allow for compound foreign keys 743384829  
1403084856 https://github.com/simonw/datasette/issues/2001#issuecomment-1403084856 https://api.github.com/repos/simonw/datasette/issues/2001 IC_kwDOBm6k_c5ToWA4 cldellow 193185 2023-01-25T04:31:02Z 2023-01-25T04:31:02Z CONTRIBUTOR

Aha, it's user error on my part.

Adding

sqlite3_db_config.argtypes = [ctypes.c_void_p, ctypes.c_int, ctypes.c_int, ctypes.c_int]

makes it work reliably both on the CLI and from datasette, and now I can reproduce the errors you mentioned in the issue description.

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Datasette is not compatible with SQLite's strict quoting compilation option 1553615704  
1399589414 https://github.com/simonw/datasette/pull/1159#issuecomment-1399589414 https://api.github.com/repos/simonw/datasette/issues/1159 IC_kwDOBm6k_c5TbAom cldellow 193185 2023-01-22T19:48:41Z 2023-01-22T19:48:41Z CONTRIBUTOR

Hey @lovasoa, I hope you don't mind - I pulled this PR into datasette-ui-extras, a plugin I'm making that collects UI tweaks to Datasette.

You can apply it to your own Datasette instance by running datasette install datasette-ui-extras

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Improve the display of facets information 774332247  
1399341761 https://github.com/simonw/datasette/issues/1101#issuecomment-1399341761 https://api.github.com/repos/simonw/datasette/issues/1101 IC_kwDOBm6k_c5TaELB simonw 9599 2023-01-21T22:07:19Z 2023-01-21T22:07:19Z OWNER

Idea for supporting streaming with the register_output_renderer hook:

python @hookimpl def register_output_renderer(datasette): return { "extension": "test", "render": render_demo, "can_render": can_render_demo, "render_stream": render_demo_stream, # This is new } So there's a new "render_stream" key which can be returned, which if present means that the output renderer supports streaming.

I'll play around with the design of that function signature in:

  • 1999

  • 1062

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
register_output_renderer() should support streaming data 749283032  
1356842576 https://github.com/simonw/datasette/issues/1886#issuecomment-1356842576 https://api.github.com/repos/simonw/datasette/issues/1886 IC_kwDOBm6k_c5Q38ZQ stevecrawshaw 18738650 2022-12-18T17:34:20Z 2022-12-18T17:34:20Z NONE

A bit late to this, but I have made an app to publish air quality data in Bristol, UK. air quality data in Bristol, UK. Next step to see if I can make a streamlit app based on this to produce some nice charts.

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Call for birthday presents: if you're using Datasette, let us know how you're using it here 1447050738  
1352644267 https://github.com/simonw/datasette/issues/1958#issuecomment-1352644267 https://api.github.com/repos/simonw/datasette/issues/1958 IC_kwDOBm6k_c5Qn7ar simonw 9599 2022-12-13T18:33:32Z 2022-12-13T18:33:32Z OWNER

When you run --root you need to follow the special link that gets output to the console:

% datasette --root http://127.0.0.1:8001/-/auth-token?token=036d8055cc8000e9667f21c1dd08722a9358c066463873ad9566d23d88765c52 INFO: Started server process [53934] INFO: Waiting for application startup. INFO: Application startup complete. That /-/auth-token?... link is the one that sets the cookie and lets you in.

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
datasette --root running in Docker doesn't reliably show the magic URL 1497909798  
1320394127 https://github.com/simonw/sqlite-utils/issues/510#issuecomment-1320394127 https://api.github.com/repos/simonw/sqlite-utils/issues/510 IC_kwDOCGYnMM5Os52P ar-jan 1176293 2022-11-18T18:37:51Z 2022-11-18T18:37:51Z NONE

I guess it is not incorrect when it says the version is 4, though it is confusing. Maybe it doesn't even refer to FTS4/FTS5 versions, but something else? In any case, it's not related to sqlite-utils, but SQLite itself.

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Cannot enable FTS5 despite it being available 1434911255  
1319574972 https://github.com/simonw/datasette/issues/1900#issuecomment-1319574972 https://api.github.com/repos/simonw/datasette/issues/1900 IC_kwDOBm6k_c5Opx28 simonw 9599 2022-11-18T05:41:28Z 2022-11-18T05:41:28Z OWNER

Oh this is with datasette package? That should work. Will investigate.

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
datasette package --spatialite throws error during build 1452572348  
1317681193 https://github.com/simonw/datasette/pull/1893#issuecomment-1317681193 https://api.github.com/repos/simonw/datasette/issues/1893 IC_kwDOBm6k_c5Oijgp bgrins 95570 2022-11-16T21:19:13Z 2022-11-16T21:19:13Z CONTRIBUTOR

Alright, added Cmd+Enter to submit (Ctrl+Enter on Windows as well bc of using Meta-Enter on codemirror). We can make that MacOS only by changing the combo to Cmd+Enter specifically but I think it's probably fine to have both.

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Upgrade to CodeMirror 6, add SQL autocomplete 1450363982  
1316340865 https://github.com/simonw/datasette/pull/1893#issuecomment-1316340865 https://api.github.com/repos/simonw/datasette/issues/1893 IC_kwDOBm6k_c5OdcSB simonw 9599 2022-11-16T04:49:30Z 2022-11-16T04:49:43Z OWNER

The main issue is that we don't pass the relevant table data down to QueryView.

If you can come up with a static example JSON data structure example that does the right thing, I'm happy to refactor QueryView to make that available to the template - or even have a separate fetch() that grabs just the data needed for the autocomplete as a separate hit when the page loads (whichever has better performance implications). I'm working a fair amount in the view classes at the moment so adding this to that work would make sense.

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Upgrade to CodeMirror 6, add SQL autocomplete 1450363982  
1312821031 https://github.com/simonw/datasette/issues/1871#issuecomment-1312821031 https://api.github.com/repos/simonw/datasette/issues/1871 IC_kwDOBm6k_c5OQA8n simonw 9599 2022-11-13T21:02:06Z 2022-11-13T21:03:11Z OWNER

Actually no, I'm going to add a class of details-menu to the other details elements that SHOULD be closed. That way custom templates using <details> won't close in a surprising way.

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
API explorer tool 1427293909  
1311273063 https://github.com/simonw/datasette/issues/1880#issuecomment-1311273063 https://api.github.com/repos/simonw/datasette/issues/1880 IC_kwDOBm6k_c5OKHBn simonw 9599 2022-11-11T06:15:28Z 2022-11-11T06:15:28Z OWNER

The _internal database is intended to help Datasette handle much larger attached databases. Right now Datasette attempts to show every database on the https://latest.datasette.io/ index page and every table on the https://latest.datasette.io/fixtures database index page - but these are not paginated. If you had a database containing 1,000 tables the database index page would get pretty slow.

So I want to be able to paginate (and search) those. But to paginate them it's useful to have them in a database table itself, since then I can paginate using SQL.

My plan for _internal is to use it to implement those advanced browsing features. I've not completed this work yet though. See this issue for more details on that:

  • 417

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Datasette with many and large databases > Memory use 1433576351  
1311271298 https://github.com/simonw/datasette/issues/1880#issuecomment-1311271298 https://api.github.com/repos/simonw/datasette/issues/1880 IC_kwDOBm6k_c5OKGmC simonw 9599 2022-11-11T06:12:29Z 2022-11-11T06:12:29Z OWNER

I think you may have misunderstood this feature. This is talking about the _internal in-memory database, which maintains a set of tables that list the databases and tables that are attached to Datasette.

They're not a copy of the data itself - just a list of table names, column names and database names.

You can see what that database looks like by signing in as root - running datasette --root and clicking the link. Or you can see an example here:

  • Click the button on https://latest.datasette.io/login-as-root
  • Now visit https://latest.datasette.io/_internal

For the example instance that looks like this:

The two most interesting tables in there are these ones:

As you can see, it's just the table schema itself and the columns that make up the tables. Even if you have hundreds of databases connected each with hundreds of tables this should still only add up to a few MB of RAM.

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Datasette with many and large databases > Memory use 1433576351  
1299102108 https://github.com/simonw/datasette/issues/1879#issuecomment-1299102108 https://api.github.com/repos/simonw/datasette/issues/1879 IC_kwDOBm6k_c5Nbrmc simonw 9599 2022-11-01T20:30:54Z 2022-11-01T20:33:06Z OWNER

One idea: add a /-/debug page (or /-/tips or /-/checks) which shows the incoming requests headers and could even detect if there's an x-forwarded-host header that isn't being repeated and show a tip on how to fix that.

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Make it easier to fix URL proxy problems 1432037325  
1294034011 https://github.com/simonw/datasette/pull/1839#issuecomment-1294034011 https://api.github.com/repos/simonw/datasette/issues/1839 IC_kwDOBm6k_c5NIWRb simonw 9599 2022-10-27T20:34:37Z 2022-10-27T20:34:37Z OWNER

@dependabot rebase

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Bump black from 22.8.0 to 22.10.0 1401155623  
1293928738 https://github.com/simonw/datasette/issues/1860#issuecomment-1293928738 https://api.github.com/repos/simonw/datasette/issues/1860 IC_kwDOBm6k_c5NH8ki simonw 9599 2022-10-27T18:46:31Z 2022-10-27T18:46:31Z OWNER

I think mine has a better pattern for handling /* ... anything in here that isn't */ ... */

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
SQL query field can't begin by a comment 1424378012  
1292659986 https://github.com/simonw/datasette/issues/1860#issuecomment-1292659986 https://api.github.com/repos/simonw/datasette/issues/1860 IC_kwDOBm6k_c5NDG0S simonw 9599 2022-10-26T21:14:26Z 2022-10-26T21:15:22Z OWNER

Yeah we should fix this.

https://www.sqlite.org/lang_comment.html - SQLite also supports -- style comments.

I like how explicit the documentation is here:

SQL comments begin with two consecutive "-" characters (ASCII 0x2d) and extend up to and including the next newline character (ASCII 0x0a) or until the end of input, whichever comes first.

C-style comments begin with "/" and extend up to and including the next "/" character pair or until the end of input, whichever comes first. C-style comments can span multiple lines.

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
SQL query field can't begin by a comment 1424378012  
1271009214 https://github.com/simonw/datasette/pull/1838#issuecomment-1271009214 https://api.github.com/repos/simonw/datasette/issues/1838 IC_kwDOBm6k_c5Lwg-- simonw 9599 2022-10-07T02:01:07Z 2022-10-07T02:01:07Z OWNER

The argument that has always convinced me NOT to use target="_blank" (even for links like this one) is that it breaks browser expectations.

If you click a link with `target="_blank" on it you get a new browser window... with a disabled back button. You have to then know to close that browser window in order to return to the previous page - as opposed to hitting the "back" button like usual.

You'll note that Datasette doesn't use target="_blank" even on URLs presented in database tables - like these ones: https://latest.datasette.io/fixtures/roadside_attractions

So I'm very firmly in the anti-target-blank camp!

This is the kind of change which I'd suggest implementing as a plugin. datasette-external-links-new-windows could run a bit of JavaScript on every page that looks for <a href="..."> elements that link to off-domain pages and adds target="_blank" to them via the DOM.

That way people who like target="_blank" can have it!

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Open Datasette link in new tab 1400494162  
1251677554 https://github.com/simonw/datasette/issues/1814#issuecomment-1251677554 https://api.github.com/repos/simonw/datasette/issues/1814 IC_kwDOBm6k_c5KmxVy simonw 9599 2022-09-19T23:35:06Z 2022-09-19T23:35:06Z OWNER

It might have been useful for Datasette to show an error when started against a settings.json file that contains an invalid setting though.

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Static files not served 1378495690  
1246977989 https://github.com/simonw/sqlite-utils/issues/297#issuecomment-1246977989 https://api.github.com/repos/simonw/sqlite-utils/issues/297 IC_kwDOCGYnMM5KU1_F simonw 9599 2022-09-14T15:57:09Z 2022-09-14T15:57:09Z OWNER

Should consider how this could best handle creating columns that are integer and float as opposed to just text.

https://discord.com/channels/823971286308356157/823971286941302908/1019630014544748584 is a relevant discussion on Discord. Even if you create the schema in advance with the correct column types, this import mechanism can put empty strings in blank float/integer columns when ideally you would want to have nulls.

Related feature idea for sqlite-utils transform: - #488

Not sure how best to handle this for sqlite3 .import imports.

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Option for importing CSV data using the SQLite .import mechanism 944846776  
1233680261 https://github.com/simonw/datasette/issues/1775#issuecomment-1233680261 https://api.github.com/repos/simonw/datasette/issues/1775 IC_kwDOBm6k_c5JiHeF simonw 9599 2022-09-01T03:05:57Z 2022-09-01T03:05:57Z OWNER

OK, I'm convinced that it's time to start figuring this out.

I've done a little bit of this with Django in the past, but Datasette isn't built on Django.

It looks to me like the key library for implementing this is Babel: https://babel.pocoo.org/en/latest/

It's been around since 2007 and is very widely used: https://github.com/python-babel/babel/network/dependents?package_id=UGFja2FnZS01MDM0NTU3NQ%3D%3D

Also found these hints on getting it to work with Jinja: https://stackoverflow.com/questions/12046998/babel-doesnt-recognize-jinja2-extraction-method-for-language-support

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
i18n support 1323346408  
1221623052 https://github.com/dogsheep/pocket-to-sqlite/issues/10#issuecomment-1221623052 https://api.github.com/repos/dogsheep/pocket-to-sqlite/issues/10 IC_kwDODLZ_YM5I0H0M simonw 9599 2022-08-21T21:20:33Z 2022-08-21T21:20:33Z MEMBER

That was clearly the intention from the description of this issue: - #4

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
When running `auth` command, don't overwrite an existing auth.json file 1246826792  
1218610320 https://github.com/simonw/sqlite-utils/pull/463#issuecomment-1218610320 https://api.github.com/repos/simonw/sqlite-utils/issues/463 IC_kwDOCGYnMM5IooSQ simonw 9599 2022-08-17T23:11:07Z 2022-08-17T23:11:07Z OWNER

Thanks!

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Use Read the Docs action v1 1334416486  
1214416491 https://github.com/simonw/datasette/issues/1779#issuecomment-1214416491 https://api.github.com/repos/simonw/datasette/issues/1779 IC_kwDOBm6k_c5IYoZr simonw 9599 2022-08-14T17:07:34Z 2022-08-14T17:07:34Z OWNER

Tested that with:

datasette publish cloudrun fixtures.db --service issue-1779 --min-instances 2 --max-instances 4

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
google cloudrun updated their limits on maxscale based on memory and cpu count 1334628400  
1186657003 https://github.com/simonw/datasette/pull/1685#issuecomment-1186657003 https://api.github.com/repos/simonw/datasette/issues/1685 IC_kwDOBm6k_c5GuvLr simonw 9599 2022-07-18T01:06:58Z 2022-07-18T01:06:58Z OWNER

@dependabot rebase

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Update jinja2 requirement from <3.1.0,>=2.10.3 to >=2.10.3,<3.2.0 1180778860  
1185974145 https://github.com/simonw/sqlite-utils/issues/453#issuecomment-1185974145 https://api.github.com/repos/simonw/sqlite-utils/issues/453 IC_kwDOCGYnMM5GsIeB simonw 9599 2022-07-15T21:52:18Z 2022-07-15T21:52:18Z OWNER

I should warn you that this isn't a supported API - I reserve the right to change how it works between release without a major version bump, because it's not part of the documented API surface.

You'll be fine if you pin to exact versions of the library though!

You may find this recently-documented function useful though: https://sqlite-utils.datasette.io/en/latest/python-api.html#reading-rows-from-a-file

See: - #443

I'm going to close this issue for the moment, but if anyone wants to submit a PR that cleans up this I'll happily review it.

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
'unclosed file' warning when using insert_upsert_implementation from Python 1303169663  
1160991031 https://github.com/simonw/sqlite-utils/issues/297#issuecomment-1160991031 https://api.github.com/repos/simonw/sqlite-utils/issues/297 IC_kwDOCGYnMM5FM1E3 simonw 9599 2022-06-21T00:35:20Z 2022-06-21T00:35:20Z OWNER

Relevant TIL: https://til.simonwillison.net/sqlite/one-line-csv-operations

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Option for importing CSV data using the SQLite .import mechanism 944846776  
1160717735 https://github.com/simonw/datasette/pull/1759#issuecomment-1160717735 https://api.github.com/repos/simonw/datasette/issues/1759 IC_kwDOBm6k_c5FLyWn simonw 9599 2022-06-20T18:04:41Z 2022-06-20T18:04:41Z OWNER

I don't think this change needs any changes to the documentation: https://docs.datasette.io/en/stable/custom_templates.html#custom-templates

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Extract facet portions of table.html out into included templates 1275523220  
1154373361 https://github.com/simonw/sqlite-utils/issues/441#issuecomment-1154373361 https://api.github.com/repos/simonw/sqlite-utils/issues/441 IC_kwDOCGYnMM5Ezlbx simonw 9599 2022-06-13T20:01:25Z 2022-06-13T20:01:25Z OWNER

Yeah, at the moment the best way to do this is with search_sql(), but you're right it really isn't very intuitive.

Here's how I would do this, using a CTE trick to combine the queries: python search_sql = db["articles"].search_sql(columns=["title", "author"])) sql = f""" with search_results as ({search_sql}) select * from search_results where owner = :owner """ results = db.query(sql, {"query": "my search query", "owner": "my owner"}) I'm not sure if sqlite-utils should ever evolve to provide a better way of doing this kind of thing to be honest - if it did, it would turn into more of an ORM. Something like PeeWee may be a better option here.

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Combining `rows_where()` and `search()` to limit which rows are searched 1257724585  
1129251699 https://github.com/simonw/datasette/issues/1744#issuecomment-1129251699 https://api.github.com/repos/simonw/datasette/issues/1744 IC_kwDOBm6k_c5DTwNz simonw 9599 2022-05-17T19:44:47Z 2022-05-17T19:46:38Z OWNER

Updated docs: https://docs.datasette.io/en/latest/getting_started.html#using-datasette-on-your-own-computer and https://docs.datasette.io/en/latest/cli-reference.html#datasette-serve-help

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
`--nolock` feature for opening locked databases 1239008850  
1109174715 https://github.com/simonw/datasette/issues/1720#issuecomment-1109174715 https://api.github.com/repos/simonw/datasette/issues/1720 IC_kwDOBm6k_c5CHKm7 simonw 9599 2022-04-26T00:40:13Z 2022-04-26T00:43:33Z OWNER

Some of the things I'd like to use ?_extra= for, that may or not make sense as plugins:

  • Performance breakdown information, maybe including explain output for a query/table
  • Information about the tables that were consulted in a query - imagine pulling in additional table metadata
  • Statistical aggregates against the full set of results. This may well be a Datasette core feature at some point in the future, but being able to provide it early as a plugin would be really cool.
  • For tables, what are the other tables they can join against?
  • Suggested facets
  • Facet results themselves
  • New custom facets I haven't thought of - though the register_facet_classes hook covers that already
  • Table schema
  • Table metadata
  • Analytics - how many times has this table been queried? Would be a plugin thing
  • For geospatial data, how about a GeoJSON polygon that represents the bounding box for all returned results? Effectively this is an extra aggregation.

Looking at https://github-to-sqlite.dogsheep.net/github/commits.json?_labels=on&_shape=objects for inspiration.

I think there's a separate potential mechanism in the future that lets you add custom columns to a table. This would affect .csv and the HTML presentation too, which makes it a different concept from the ?_extra= hook that affects the JSON export (and the context that is fed to the HTML templates).

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Design plugin hook for extras 1215174094  
1105474232 https://github.com/dogsheep/github-to-sqlite/issues/72#issuecomment-1105474232 https://api.github.com/repos/dogsheep/github-to-sqlite/issues/72 IC_kwDODFdgUs5B5DK4 simonw 9599 2022-04-21T17:02:15Z 2022-04-21T17:02:15Z MEMBER

That's interesting - yeah it looks like the number of pages can be derived from the Link header, which is enough information to show a progress bar, probably using Click just to avoid adding another dependency.

https://docs.github.com/en/rest/guides/traversing-with-pagination

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
feature: display progress bar when downloading multi-page responses 1211283427  
1098548931 https://github.com/simonw/sqlite-utils/issues/421#issuecomment-1098548931 https://api.github.com/repos/simonw/sqlite-utils/issues/421 IC_kwDOCGYnMM5BeobD simonw 9599 2022-04-13T22:41:59Z 2022-04-13T22:41:59Z OWNER

I'm going to close this ticket since it looks like this is a bug in the way the Dockerfile builds Python, but I'm going to ship a fix for that issue I found so the LD_PRELOAD workaround above should work OK with the next release of sqlite-utils. Thanks for the detailed bug report!

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
"Error: near "(": syntax error" when using sqlite-utils indexes CLI 1180427792  
1082663746 https://github.com/simonw/datasette/issues/1692#issuecomment-1082663746 https://api.github.com/repos/simonw/datasette/issues/1692 IC_kwDOBm6k_c5AiCNC simonw 9599 2022-03-30T06:14:39Z 2022-03-30T06:14:51Z OWNER

I like your design, though I think it should be "nomodule": True for consistency with the other options.

I think "async": True is worth supporting too.

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
[plugins][feature request]: Support additional script tag attributes when loading custom JS 1182227211  
1079582485 https://github.com/simonw/datasette/issues/1688#issuecomment-1079582485 https://api.github.com/repos/simonw/datasette/issues/1688 IC_kwDOBm6k_c5AWR8V simonw 9599 2022-03-26T03:15:34Z 2022-03-26T03:15:34Z OWNER

Yup, you're right in what you figured out here: stand-alone plugins can't currently package static assets other then using the static folder.

The datasette-plugin cookiecutter template should make creating a Python package pretty easy though: https://github.com/simonw/datasette-plugin

You can run that yourself, or you can run it using this GitHub template repository: https://github.com/simonw/datasette-plugin-template-repository

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
[plugins][documentation] Is it possible to serve per-plugin static folders when writing one-off (single file) plugins? 1181432624  
1074019047 https://github.com/simonw/datasette/issues/526#issuecomment-1074019047 https://api.github.com/repos/simonw/datasette/issues/526 IC_kwDOBm6k_c5ABDrn simonw 9599 2022-03-21T15:09:56Z 2022-03-21T15:09:56Z OWNER

I should research how much overhead creating a new connection costs - it may be that an easy way to solve this is to create A dedicated connection for the query and then close that connection at the end.

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Stream all results for arbitrary SQL and canned queries 459882902  
1066222323 https://github.com/simonw/datasette/issues/1384#issuecomment-1066222323 https://api.github.com/repos/simonw/datasette/issues/1384 IC_kwDOBm6k_c4_jULz brandonrobertz 2670795 2022-03-14T00:36:42Z 2022-03-14T00:36:42Z CONTRIBUTOR

Ah, sorry, I didn't get what you were saying you the first time. Using _metadata_local in that way makes total sense -- I agree, refreshing metadata each cell was seeming quite excessive. Now I'm on the same page! :)

All good. Report back any issues you find with this stuff. Metadata/dynamic config hasn't been tested widely outside of what I've done AFAIK. If you find a strong use case for async meta, it's going to be better to know sooner rather than later!

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Plugin hook for dynamic metadata 930807135  
1035717429 https://github.com/dogsheep/dogsheep-photos/pull/31#issuecomment-1035717429 https://api.github.com/repos/dogsheep/dogsheep-photos/issues/31 IC_kwDOD079W849u8s1 harperreed 18504 2022-02-11T01:55:38Z 2022-02-11T01:55:38Z NONE

I would love this merged!

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Update for Big Sur 771511344  
1033772902 https://github.com/simonw/datasette/issues/236#issuecomment-1033772902 https://api.github.com/repos/simonw/datasette/issues/236 IC_kwDOBm6k_c49nh9m jordaneremieff 1376648 2022-02-09T13:40:52Z 2022-02-09T13:40:52Z NONE

Hi @simonw,

I've received some inquiries over the last year or so about Datasette and how it might be supported by Mangum. I maintain Mangum which is, as far as I know, the only project that provides support for ASGI applications in AWS Lambda.

If there is anything that I can help with here, please let me know because I think what Datasette provides to the community (even beyond OSS) is noble and worthy of special consideration.

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
datasette publish lambda plugin 317001500  
1030740653 https://github.com/simonw/sqlite-utils/issues/399#issuecomment-1030740653 https://api.github.com/repos/simonw/sqlite-utils/issues/399 IC_kwDOCGYnMM49b9qt eyeseast 25778 2022-02-06T02:57:17Z 2022-02-06T02:57:17Z CONTRIBUTOR

I like the idea of having stock conversions you could import. I'd actually move them to a dedicated module (call it sqlite_utils.conversions or something), because it's different from other utilities. Maybe they even take configuration, or they're composable.

```python from sqlite_utils.conversions import LongitudeLatitude

db["places"].insert( { "name": "London", "lng": -0.118092, "lat": 51.509865, }, conversions={"point": LongitudeLatitude("lng", "lat")}, ) ```

I would definitely use that for every CSV I get with lat/lng columns where I actually need GeoJSON.

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Make it easier to insert geometries, with documentation and maybe code 1124731464  
1029285985 https://github.com/simonw/sqlite-utils/pull/385#issuecomment-1029285985 https://api.github.com/repos/simonw/sqlite-utils/issues/385 IC_kwDOCGYnMM49Wahh simonw 9599 2022-02-03T18:37:48Z 2022-02-03T18:37:48Z OWNER

from sqlite_utils.utils import find_spatialite is part of the documented API already:

https://sqlite-utils.datasette.io/en/3.22.1/python-api.html#finding-spatialite

To avoid needing to bump the major version number to 4 to indicate a backwards incompatible change, we should keep a from .gis import find_spatialite line at the top of utils.py such that any existing code with that documented import continues to work.

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Add new spatialite helper methods 1102899312  
1021860694 https://github.com/simonw/datasette/issues/1613#issuecomment-1021860694 https://api.github.com/repos/simonw/datasette/issues/1613 IC_kwDOBm6k_c486FtW simonw 9599 2022-01-26T04:57:53Z 2022-01-26T04:57:53Z OWNER

The existing flow where you can apply filters to a table and then click "View and edit SQL" to see the query is a good starting point.

Group by queries are both crucially important and difficult to assemble for beginners. Providing a way to see the query that was used by a facet (since facets are really just group-by-counts) would be very useful, which could come out of this:

  • 1080

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Improvements to help make Datasette a better tool for learning SQL 1114628238  
1017998993 https://github.com/simonw/datasette/issues/1608#issuecomment-1017998993 https://api.github.com/repos/simonw/datasette/issues/1608 IC_kwDOBm6k_c48rW6R simonw 9599 2022-01-20T22:56:00Z 2022-01-20T22:56:00Z OWNER

https://sphinx-version-warning.readthedocs.io/ looks like it can show a banner for "You are looking at v0.36 but you should be looking at 0.40" but doesn't hand the case I need here which is "you are looking at /latest/ but you should be looking at /stable/".

Correction! That tool DOES support that, as can be seen in their example configuration for their own documentation:

https://github.com/humitos/sphinx-version-warning/blob/a82156c2ea08e5feab406514d0ccd9d48a345f48/docs/conf.py#L32-L38

python versionwarning_messages = { 'latest': 'This is a custom message only for version "latest" of this documentation.', } versionwarning_admonition_type = 'tip' versionwarning_banner_title = 'Tip' versionwarning_body_selector = 'div[itemprop="articleBody"]'

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Documentation should clarify /stable/ vs /latest/ 1109808154  
995034143 https://github.com/simonw/datasette/issues/1552#issuecomment-995034143 https://api.github.com/repos/simonw/datasette/issues/1552 IC_kwDOBm6k_c47TwQf simonw 9599 2021-12-15T18:02:53Z 2021-12-15T18:02:53Z OWNER

This is definitely a missing feature. The "different types of facet" stuff feels incomplete to me generally - this is one issue, but this one as well:

  • 625

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Allow to set `facets_array` in metadata (like current `facets`) 1078702875  
991754794 https://github.com/simonw/datasette/issues/1549#issuecomment-991754794 https://api.github.com/repos/simonw/datasette/issues/1549 IC_kwDOBm6k_c47HPoq simonw 9599 2021-12-11T19:16:33Z 2021-12-11T19:16:33Z OWNER

Good call! I'm doing a refactor #1518 right now which will hopefully bring the functionality of those two much closer - I'll make a note to consider this there too.

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Redesign CSV export to improve usability 1077620955  
991378346 https://github.com/simonw/sqlite-utils/issues/353#issuecomment-991378346 https://api.github.com/repos/simonw/sqlite-utils/issues/353 IC_kwDOCGYnMM47Fzuq simonw 9599 2021-12-10T23:48:28Z 2021-12-10T23:48:28Z OWNER

One option: allow CODE to be a special value of - which means "read from standard input". It's a tiny bit of a hack but I think it would work here.

If you wanted to replace a column entirely with hyphens you would still be able to do this:

sqlite-utils convert my.db mytable col1 '"-"'
{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Allow passing a file of code to "sqlite-utils convert" 1077102934  
988463455 https://github.com/simonw/datasette/issues/1304#issuecomment-988463455 https://api.github.com/repos/simonw/datasette/issues/1304 IC_kwDOBm6k_c466sFf 20after4 30934 2021-12-08T03:23:14Z 2021-12-08T03:23:14Z NONE

I actually think it would be a useful thing to add support for in datasette. It wouldn't be difficult to unwind an array of params and add the placeholders automatically.

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Document how to send multiple values for "Named parameters"  863884805  
981980048 https://github.com/simonw/datasette/issues/1304#issuecomment-981980048 https://api.github.com/repos/simonw/datasette/issues/1304 IC_kwDOBm6k_c46h9OQ 20after4 30934 2021-11-29T20:13:53Z 2021-11-29T20:14:11Z NONE

There isn't any way to do this with sqlite as far as I know. The only option is to insert the right number of ? placeholders into the sql template and then provide an array of values.

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Document how to send multiple values for "Named parameters"  863884805  
976117989 https://github.com/simonw/datasette/issues/1522#issuecomment-976117989 https://api.github.com/repos/simonw/datasette/issues/1522 IC_kwDOBm6k_c46LmDl glasnt 813732 2021-11-23T03:00:34Z 2021-11-23T03:00:34Z CONTRIBUTOR

I tried deploying the most recent version of the Dockerfile in this thread (link to comment), and after trying a few different different combinations, I was only successful when I used --no-cpu-throttling ("CPU Is always allocated" in the UI)

Using this method, I got a very similar issue to you: The first time I'd load the site I'd get a 503. But after that first load, I didn't get the issue again. It would re-occur if the service started from cold boot.

I suspect this is a race condition in the supervisord configuration. The errors I got were the same Connection refused: AH00957: http: attempt to connect to 127.0.0.1:8001 (127.0.0.1) failed, and that seems to indicate that datasette hadn't yet started.

Looking at the order of logs getting back, the processes reported successfully completing loading after the first 503 was returned, so that makes me think race condition.

I can replicate this locally, if I docker run and request localhost:5000/prefix before I get the datasette entered RUNNING state message. Cloud Run wakes up when requests are received, so this test would semi-replicate that, but local docker would be the equivalent of a persistent process, hence it doesn't normally exhibit the same issues.

Unfortunately supervisor/supervisor issue 122 (not linking as to prevent cross-project link spam) seems to say that dependency chaining is a feature that's been asked for for a long time, but hasn't been implemented. You could try some suggestions in that thread.

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Deploy a live instance of demos/apache-proxy 1058896236  
962411119 https://github.com/simonw/sqlite-utils/issues/336#issuecomment-962411119 https://api.github.com/repos/simonw/sqlite-utils/issues/336 IC_kwDOCGYnMM45XTpv simonw 9599 2021-11-06T07:21:04Z 2021-11-06T07:21:04Z OWNER

I've never used DEFAULT 'CURRENT_TIMESTAMP' myself so this one should be an interesting bug to explore.

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
sqlite-util tranform --column-order mangles columns of type "timestamp" 1044267332  
949604763 https://github.com/simonw/datasette/issues/1284#issuecomment-949604763 https://api.github.com/repos/simonw/datasette/issues/1284 IC_kwDOBm6k_c44mdGb fgregg 536941 2021-10-22T12:54:34Z 2021-10-22T12:54:34Z CONTRIBUTOR

i'm going to take a swing at this today. we'll see.

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Feature or Documentation Request: Individual table as home page template 845794436  
943594712 https://github.com/simonw/datasette/pull/1489#issuecomment-943594712 https://api.github.com/repos/simonw/datasette/issues/1489 IC_kwDOBm6k_c44PhzY simonw 9599 2021-10-14T18:04:11Z 2021-10-14T18:04:11Z OWNER

@dependabot recreate

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Update pyyaml requirement from ~=5.3 to >=5.3,<7.0 1026379132  
942722595 https://github.com/simonw/datasette/pull/1487#issuecomment-942722595 https://api.github.com/repos/simonw/datasette/issues/1487 IC_kwDOBm6k_c44MM4j simonw 9599 2021-10-13T21:08:53Z 2021-10-13T21:08:53Z OWNER

Thanks for this!

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Added instructions for installing plugins via pipx, #1486 1023245060  
925321439 https://github.com/simonw/sqlite-utils/issues/325#issuecomment-925321439 https://api.github.com/repos/simonw/sqlite-utils/issues/325 IC_kwDOCGYnMM43J0jf simonw 9599 2021-09-22T20:52:56Z 2021-09-22T20:52:56Z OWNER

Updated documentation: https://sqlite-utils.datasette.io/en/latest/cli.html#running-queries-directly-against-csv-or-json

If two files have the same name they will be assigned a numeric suffix:

$ sqlite-utils memory foo/data.csv bar/data.csv "select * from data_2"
{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
sqlite-utils memory can't deal with multiple files with the same name 990844088  
925296085 https://github.com/simonw/sqlite-utils/issues/328#issuecomment-925296085 https://api.github.com/repos/simonw/sqlite-utils/issues/328 IC_kwDOCGYnMM43JuXV simonw 9599 2021-09-22T20:14:53Z 2021-09-22T20:14:53Z OWNER

The bug is in this code: https://github.com/simonw/sqlite-utils/blob/77c240df56068341561e95e4a412cbfa24dc5bc7/sqlite_utils/cli.py#L2205-L2227

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Invalid JSON output when no rows 1004613267  
913001416 https://github.com/simonw/datasette/pull/1455#issuecomment-913001416 https://api.github.com/repos/simonw/datasette/issues/1455 IC_kwDOBm6k_c42a0vI simonw 9599 2021-09-04T16:32:21Z 2021-09-04T16:32:21Z OWNER

I'll add researchers too.

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Add scientists to target groups 988325628  
913001282 https://github.com/simonw/datasette/pull/1455#issuecomment-913001282 https://api.github.com/repos/simonw/datasette/issues/1455 IC_kwDOBm6k_c42a0tC ctb 51016 2021-09-04T16:31:24Z 2021-09-04T16:31:24Z CONTRIBUTOR

I love it! maybe 'researchers' instead? Or 'scientists and researchers'?

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Add scientists to target groups 988325628  
897996296 https://github.com/simonw/datasette/issues/942#issuecomment-897996296 https://api.github.com/repos/simonw/datasette/issues/942 IC_kwDOBm6k_c41hlYI simonw 9599 2021-08-12T22:01:36Z 2021-08-12T22:01:36Z OWNER

I'm going with "columns": {"name-of-column": "description-of-column"}.

If I decide to make "col" and "nocol" available in metadata I'll use those as the keys in the metadata, for consistency with the existing query string parameters.

I'm OK with having both "columns": ... and "col": ... keys in the metadata, even though they could be a tiny bit confusing without the documentation.

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Support column descriptions in metadata.json 681334912  
891359751 https://github.com/simonw/sqlite-utils/issues/298#issuecomment-891359751 https://api.github.com/repos/simonw/sqlite-utils/issues/298 IC_kwDOCGYnMM41IRIH simonw 9599 2021-08-02T21:55:16Z 2021-08-02T21:55:16Z OWNER

This is a feature already! You can do this:

sqlite-utils insert nl-demo.db mytable data.ndjson --nl

See https://sqlite-utils.datasette.io/en/stable/cli.html#inserting-newline-delimited-json

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Read lines with JSON object 951581763  
880326049 https://github.com/simonw/datasette/issues/1396#issuecomment-880326049 https://api.github.com/repos/simonw/datasette/issues/1396 MDEyOklzc3VlQ29tbWVudDg4MDMyNjA0OQ== simonw 9599 2021-07-15T01:50:05Z 2021-07-15T01:50:05Z OWNER

I think I made a mistake in this commit: https://github.com/simonw/datasette/commit/0486303b60ce2784fd2e2ecdbecf304b7d6e6659

It looks like I copied $VERSION_TAG from here - but it's not available in the publish.yml flow: https://github.com/simonw/datasette/blob/0486303b60ce2784fd2e2ecdbecf304b7d6e6659/.github/workflows/push_docker_tag.yml#L18-L25

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
"invalid reference format" publishing Docker image 944903881  
864128489 https://github.com/simonw/sqlite-utils/issues/278#issuecomment-864128489 https://api.github.com/repos/simonw/sqlite-utils/issues/278 MDEyOklzc3VlQ29tbWVudDg2NDEyODQ4OQ== simonw 9599 2021-06-18T15:46:24Z 2021-06-18T15:46:24Z OWNER

A workaround could be to define a bash or zsh alias of some sort.

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Support db as first parameter before subcommand, or as environment variable 923697888  
861987651 https://github.com/simonw/sqlite-utils/issues/272#issuecomment-861987651 https://api.github.com/repos/simonw/sqlite-utils/issues/272 MDEyOklzc3VlQ29tbWVudDg2MTk4NzY1MQ== simonw 9599 2021-06-16T02:27:20Z 2021-06-16T02:27:20Z OWNER

Solution: sqlite-utils memory - attempts to detect the input based on if it starts with a { or [ (likely JSON) or if it doesn't use the csv.Sniffer() mechanism. Or you can use sqlite-utils memory -:csv to specifically indicate the type of input.

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Idea: import CSV to memory, run SQL, export in a single command 921878733  
860548546 https://github.com/simonw/datasette/issues/1375#issuecomment-860548546 https://api.github.com/repos/simonw/datasette/issues/1375 MDEyOklzc3VlQ29tbWVudDg2MDU0ODU0Ng== frafra 4068 2021-06-14T09:41:59Z 2021-06-14T09:41:59Z NONE

There is a feature for this at the moment, but it's a little bit hidden: you can use ?_json=col to tell Datasette that you would like a specific column to be exported as nested JSON: https://docs.datasette.io/en/stable/json_api.html#special-json-arguments

Thanks :)

I considered trying to make this automatic - so it detects columns that appear to contain valid JSON and outputs them as nested objects - but the problem with that is that it can lead to inconsistent results - you might hit the API and find that not every column contains valid JSON (compared to the previous day) resulting in the API retuning string instead of the expected dictionary and breaking your code.

If a developer is not sure if the JSON fields are valid, but then retrieves and parse them, it should handle errors too. Handling inconsistent data is necessary due to the nature of SQLite. A global or dataset option to render the data as they have been defined (JSON, boolean, etc.) when requesting JSON could allow the user to download a regular JSON from the browser without having to rely on APIs. I would guess someone could just make a custom template with an extra JSON-parsed download button otherwise :)

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
JSON export dumps JSON fields as TEXT 919508498  
860230385 https://github.com/simonw/datasette/issues/1375#issuecomment-860230385 https://api.github.com/repos/simonw/datasette/issues/1375 MDEyOklzc3VlQ29tbWVudDg2MDIzMDM4NQ== simonw 9599 2021-06-13T15:37:49Z 2021-06-13T15:37:49Z OWNER

There is a feature for this at the moment, but it's a little bit hidden: you can use ?_json=col to tell Datasette that you would like a specific column to be exported as nested JSON: https://docs.datasette.io/en/stable/json_api.html#special-json-arguments

I considered trying to make this automatic - so it detects columns that appear to contain valid JSON and outputs them as nested objects - but the problem with that is that it can lead to inconsistent results - you might hit the API and find that not every column contains valid JSON (compared to the previous day) resulting in the API retuning string instead of the expected dictionary and breaking your code.

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
JSON export dumps JSON fields as TEXT 919508498  
853567861 https://github.com/simonw/sqlite-utils/issues/264#issuecomment-853567861 https://api.github.com/repos/simonw/sqlite-utils/issues/264 MDEyOklzc3VlQ29tbWVudDg1MzU2Nzg2MQ== simonw 9599 2021-06-03T05:12:21Z 2021-06-03T05:12:21Z OWNER

I think this is more likely to happen in Datasette than in sqlite-utils - see https://github.com/simonw/datasette/issues/1356 for thoughts on this.

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Supporting additional output formats, like GeoJSON 907642546  
853567413 https://github.com/simonw/datasette/issues/526#issuecomment-853567413 https://api.github.com/repos/simonw/datasette/issues/526 MDEyOklzc3VlQ29tbWVudDg1MzU2NzQxMw== simonw 9599 2021-06-03T05:11:27Z 2021-06-03T05:11:27Z OWNER

Another potential way to implement this would be to hold the SQLite connection open and execute the full query there.

I've avoided this in the past due to concerns of resource exhaustion - if multiple requests attempt this at the same time all of the connections in the pool will become tied up and the site will be unable to respond to further requests.

But... now that Datasette has authentication there's the possibility of making this feature only available to specific authenticated users - the --root user for example. Which avoids the danger while unlocking a super-useful feature.

Not to mention people who are running Datasette privately on their own laptop, or the proposed --query CLI feature in #1356.

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Stream all results for arbitrary SQL and canned queries 459882902  
852673695 https://github.com/simonw/datasette/pull/1352#issuecomment-852673695 https://api.github.com/repos/simonw/datasette/issues/1352 MDEyOklzc3VlQ29tbWVudDg1MjY3MzY5NQ== simonw 9599 2021-06-02T02:52:26Z 2021-06-02T02:52:26Z OWNER

@dependabot recreate

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Bump black from 21.5b1 to 21.5b2 908276134  
843718859 https://github.com/simonw/sqlite-utils/issues/253#issuecomment-843718859 https://api.github.com/repos/simonw/sqlite-utils/issues/253 MDEyOklzc3VlQ29tbWVudDg0MzcxODg1OQ== simonw 9599 2021-05-19T03:31:47Z 2021-05-19T03:31:47Z OWNER

Fixed: https://simonwillison.net/2020/Sep/23/sqlite-advanced-alter-table/

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
fixtures.db example error in sql-utils blog post 847423559  
843702392 https://github.com/simonw/sqlite-utils/pull/258#issuecomment-843702392 https://api.github.com/repos/simonw/sqlite-utils/issues/258 MDEyOklzc3VlQ29tbWVudDg0MzcwMjM5Mg== simonw 9599 2021-05-19T02:47:37Z 2021-05-19T02:47:37Z OWNER

I'm going to merge this and add a test - thanks!

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Fixing insert from JSON containing strings with non-ascii characters … 868191959  
815978405 https://github.com/simonw/datasette/issues/1286#issuecomment-815978405 https://api.github.com/repos/simonw/datasette/issues/1286 MDEyOklzc3VlQ29tbWVudDgxNTk3ODQwNQ== mroswell 192568 2021-04-08T16:47:29Z 2021-04-10T03:59:00Z CONTRIBUTOR

This worked for me:
<td class="col-{{ cell.column|to_css_class }} type-{{ cell.value_type }}">{{ cell.value | replace('", "','; ') | replace('[\"','') | replace('\"]','')}}</td>

I'm sure there is a prettier (and more flexible) way, but for now, this is ever-so-much more pleasant to look at.

------ AFTER:

------ BEFORE:

(Note: I didn't figure out how to have one item have no semicolon, while multi-items close with a semicolon, but this is good enough for now. I also didn't figure out how to set up a new jinja filter. I don't want to add to /datasette/utils/init.py as I assume that would get overwritten when upgrading datasette. Having a starter guide on creating jinja filters in datasette would be helpful. (The jinja documentation isn't datasette-specific enough for me to quite nail it.)

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Better default display of arrays of items 849220154  
812710120 https://github.com/simonw/datasette/issues/1255#issuecomment-812710120 https://api.github.com/repos/simonw/datasette/issues/1255 MDEyOklzc3VlQ29tbWVudDgxMjcxMDEyMA== jungle-boogie 1111743 2021-04-02T20:50:08Z 2021-04-02T20:50:08Z NONE

Hello again,

I was able to get my facets running with this settings.json, which was lifted from one of Simon's datasette's and slightly modified.

{ "default_page_size": 100, "max_returned_rows": 1000, "num_sql_threads": 3, "sql_time_limit_ms": 9000, "default_facet_size": 10, "facet_time_limit_ms": 9000, "facet_suggest_time_limit_ms": 500, "hash_urls": false, "allow_facet": true, "suggest_facets": false, "default_cache_ttl": 5, "default_cache_ttl_hashed": 31536000, "cache_size_kb": 0, "allow_csv_stream": true, "max_csv_mb": 100, "truncate_cells_html": 2048, "template_debug": false, "base_url": "/" }

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Facets timing out but work when filtering 826700095  
812664443 https://github.com/simonw/datasette/issues/1286#issuecomment-812664443 https://api.github.com/repos/simonw/datasette/issues/1286 MDEyOklzc3VlQ29tbWVudDgxMjY2NDQ0Mw== simonw 9599 2021-04-02T18:52:45Z 2021-04-02T18:52:51Z OWNER

Idea: default to displaying single-dimension JSON arrays of strings as a comma-separated list but show the comma in a different colour - something like this:

I used this HTML for the prototype (re-using .type-int just to get the colour): ```html

<td class="col-tags type-str">tag1, tag2</td>

```

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Better default display of arrays of items 849220154  

Next page

Advanced export

JSON shape: default, array, newline-delimited, object

CSV options:

CREATE TABLE [issue_comments] (
   [html_url] TEXT,
   [issue_url] TEXT,
   [id] INTEGER PRIMARY KEY,
   [node_id] TEXT,
   [user] INTEGER REFERENCES [users]([id]),
   [created_at] TEXT,
   [updated_at] TEXT,
   [author_association] TEXT,
   [body] TEXT,
   [reactions] TEXT,
   [issue] INTEGER REFERENCES [issues]([id])
, [performed_via_github_app] TEXT);
CREATE INDEX [idx_issue_comments_issue]
                ON [issue_comments] ([issue]);
CREATE INDEX [idx_issue_comments_user]
                ON [issue_comments] ([user]);
Powered by Datasette · Queries took 390.698ms · About: github-to-sqlite