Commit Graph

5 Commits

Author SHA1 Message Date
Wez Furlong 0c70ab2c52 improve error message when converting lua -> rust types
refs: https://github.com/KumoCorp/kumomta/issues/56
2023-06-14 20:14:14 -07:00
Wez Furlong b6633b95dc sqlite: bind params as strings, fixup empty rows case
We were binding as blobs which we could read back as strings,
but which didn't match string inputs! Very confusing!
Always bind as strings.

For the empty rows case: don't return the affected row count
unless the query has 0 columns, as we otherwise cannot distinguish
between no matching results and a single column with 0.
2023-03-22 17:01:07 -07:00
Wez Furlong 8e0583b6cf adopt tokio::task::Builder to label tasks 2023-03-06 09:38:18 -07:00
Wez Furlong eaaddbb6b6 add redis client 2023-03-05 09:57:03 -07:00
Wez Furlong 2cf3d2387c add sqlite data access
A bit of a big commit because I wanted sqlite queries to run
async and there isn't a sane way to tell in mlua whether a
given context is safe to yield for an await, which meant making
every case where we call into lua be fully async.

This adds a simple but powerful binding to sqlite that performs
its IO in a blocking tokio thread pool, and returns the results
back to lua.

There is no implicit caching of queries, and no implicit connection
pooling.
2023-03-04 18:07:31 -07:00