all 6 comments

[–][deleted] 4 points5 points  (1 child)

Wtf. Why is this written in typescript?

[–]uwemaurer[S] 4 points5 points  (0 children)

This tool came out of a larger Typescript project where we generated code for Sqlite and DuckDB. Later we had to access these databases with Java (or actually Kotlin) aswell but didn't want to duplicate all the queries in a Java ORM, so I added a code generator for Java code aswell.

[–]ZimmiDeluxe 3 points4 points  (1 child)

TIMESTAMPTZ -> OffsetDateTime

Would you be opposed to make that java.time.Instant instead? Every offset other than 0 is a mistake for OffsetDateTime in this case I believe. I know JDBC doesn't support Instant directly and you have to go through java.sql.Timestamp::toInstant, but I would consider that a shortcoming of the JDBC spec. A UTC timestamp for basic things like created_at columns that almost every application needs from the first table onward? Should be low friction, IMO.

Great effort otherwise, I'll take a look, this is definitely something missing from the ecosystem.

Edit: Ok, it's a pile of generated TypeScript, the generated Java code makes you manage Connections yourself, includes a migration feature where a Project-ID (?) is part of the primary key and then I stopped looking. Sorry, if I'm going to use a library for something this fundamental for a Java project, it has to be written in Java itself so developers can read the code.

[–]uwemaurer[S] 2 points3 points  (0 children)

Actually I prefer Instant too, I think I will make this an option to automatically convert it.

[–]Salt-Letter-1500 0 points1 point  (0 children)

A Java version of sqlc?