Skip to content

Conversation

@simonw
Copy link
Owner

@simonw simonw commented Nov 29, 2025

This allows users to pass just a callable reference like r.parsedate
instead of r.parsedate(value) to the convert command. The code now
detects when the input evaluates to a callable and uses it directly.

Examples that now work:

  • sqlite-utils convert my.db table col r.parsedate
  • sqlite-utils convert my.db table col json.loads --import json

📚 Documentation preview 📚: https://sqlite-utils--690.org.readthedocs.build/en/690/

Claude Code for web prompt (I literally just pasted in the URL to the issue):

https://github.com/simonw/sqlite-utils/issues/686

@codecov
Copy link

codecov bot commented Nov 29, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.34%. Comparing base (f9e5fbb) to head (29b0722).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #690   +/-   ##
=======================================
  Coverage   95.33%   95.34%           
=======================================
  Files           8        8           
  Lines        3001     3007    +6     
=======================================
+ Hits         2861     2867    +6     
  Misses        140      140           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

This allows users to pass just a callable reference like `r.parsedate`
instead of `r.parsedate(value)` to the convert command. The code now
detects when the input evaluates to a callable and uses it directly.

Examples that now work:
- sqlite-utils convert my.db table col r.parsedate
- sqlite-utils convert my.db table col json.loads --import json
@simonw simonw force-pushed the claude/custom-json-serialization-01BDiG528eJwG6jvpfKum6sc branch from 0daf17a to 29b0722 Compare November 29, 2025 20:36
@simonw simonw linked an issue Nov 29, 2025 that may be closed by this pull request
@simonw
Copy link
Owner Author

simonw commented Nov 29, 2025

@simonw
Copy link
Owner Author

simonw commented Nov 29, 2025

Manually tested this like so:

echo '{"date": "13th January 2025"}' | sqlite-utils insert dates.db dates -
sqlite-utils convert dates.db dates date r.parsedate
sqlite-utils rows dates.db dates

Output:

[{"date": "2025-01-13"}]

@simonw simonw merged commit 5a7f522 into main Nov 29, 2025
90 checks passed
@simonw simonw added enhancement New feature or request cli-tool labels Nov 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli-tool enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Idea: sqlite-utils convert my.db articles created_at r.parsedate

3 participants