Hi all! I'm venturing in from .NET land. I'm looki...
# getting-started
k
Hi all! I'm venturing in from .NET land. I'm looking for a SQL library. I'm accustomed to running parameterized string queries and getting back a DataReader that I can use to pull fields and rows. Similar to JDBC but asynchronous. Then another library -- Dapper -- maps DataReaders to plain objects. I'm not really into object-defined tables or sql DSLs. Where should I look?
For reference, here is a library I created to stitch those pieces together, directly returning a collection of objects from a query https://github.com/XeSoft/SlimSql
Looking for something like that or pieces I can use to make it.
k
Thanks, I'll add it to my research list
r
Also check out #exposed
r
Im using SQLDelight, if you are doing all DataReader stuff it should feel like you are right at home, (though i should mention that while you dont HAVE to use objects , you really should lol)
s
at my previous job, we used jOOQ and liked it a lot.
j
I posted the r2dbc docs because of the requirement for async. I actually normally use spring jdbcTemplate. It has a queryForStream method that if configured correctly will be backed by a cursor on the db as opposed to loading the whole resultset into memory. Not exactly async but might be what you're looking for.
k
it looks like a tiny subset of jooq does what I'm after. https://www.jooq.org/doc/latest/manual/getting-started/use-cases/jooq-as-a-sql-executor/
Copy code
// Use your favourite tool to construct SQL strings:
String sql = "SELECT title, first_name, last_name FROM book JOIN author ON book.author_id = author.id " +
             "WHERE book.published_in = 1984";

// Fetch results using jOOQ
Result<Record> result = create.fetch(sql);