Skip to content

Add custom encoder/decoder api for sqlite#40

Merged
blaix merged 9 commits intonextfrom
sqlite-encoders-decoders
Apr 27, 2026
Merged

Add custom encoder/decoder api for sqlite#40
blaix merged 9 commits intonextfrom
sqlite-encoders-decoders

Conversation

@blaix
Copy link
Copy Markdown
Contributor

@blaix blaix commented Apr 24, 2026

Thoughts on the API here?

@blaix blaix requested a review from robinheghan April 24, 2026 01:58
Copy link
Copy Markdown
Member

@robinheghan robinheghan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall I think this looks great!

We need a way to encode/decode Json to/from columns, and I'm not sure about exposing escape hatches for the Encoder/Decoder API's, but other than that this looks great!

Comment thread integration-tests/sqlite/src/Main.gren Outdated
Comment thread integration-tests/sqlite/src/Main.gren
Comment thread src/Sqlite/Decode.gren
Comment thread src/Sqlite/Encode.gren
Comment thread src/Sqlite/Encode.gren
@blaix
Copy link
Copy Markdown
Contributor Author

blaix commented Apr 24, 2026

I'm torn on the idea of an escape hatch. We could have raw functions in the Encoder and Decoder that take json encoders/decoders. It might be useful, but I wonder if that's needed or would get confused with the actual json encoder/decoder functions?

@robinheghan
Copy link
Copy Markdown
Member

I'm torn on the idea of an escape hatch. We could have raw functions in the Encoder and Decoder that take json encoders/decoders. It might be useful, but I wonder if that's needed or would get confused with the actual json encoder/decoder functions?

I think we can start without the escape hatch, and introduce it once we have a use case for it.

Comment thread src/Sqlite/Decode.gren Outdated
to match unix epoch as sqlite understands it
Comment thread integration-tests/sqlite/src/Main.gren Outdated
blaix added 3 commits April 25, 2026 06:29
TRUE and FALSE are keywords, not literal string values supported in
boolean fields.
the time encoder drops subsecond precision for efficiency
Copy link
Copy Markdown
Member

@robinheghan robinheghan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work on this 🥳

@blaix blaix merged commit 2a7cc87 into next Apr 27, 2026
@blaix blaix deleted the sqlite-encoders-decoders branch April 27, 2026 01:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants