Fork me on GitHub
#sql
<
2019-11-17
>
seancorfield00:11:45

First cut of documentation for middleware: https://github.com/seancorfield/next-jdbc/blob/master/doc/middleware.md -- feedback and suggestions welcome!

seancorfield00:11:37

I suspect most people will be more excited about a way to provide default options 🙂 but I think I know at least one person here who might be excited about the logging aspects of middleware!

seancorfield00:11:02

I'd appreciate at least some folks actually walking through that documentation and making sure that the examples really work for them.

👍 4
seancorfield03:11:49

Also, TIL: timestamp in SQL Server is not like other databases -- it's a monotonically increasing numeric type that you cannot insert values into! So my tests have to use datetime for MS SQL and timestamp for everything else. Good job SQL is standardized, eh?

kszabo09:11:16

have you considered using interceptors in place of the middleware pattern? https://quanttype.net/posts/2018-08-03-why-interceptors.html

seancorfield17:11:58

@thenonameguy because of the way next.jdbc was designed and optimized for performance, neither a strict middleware approach nor a strict interceptor approach would work. If you look at what I've implemented, you'll see it's really part middleware and part interceptor: it wraps the connectable and the builder like middleware in order to provide four interception points (pre/post/row/resultset).

kszabo08:11:07

@U04V70XH6 understood, thanks for the insight.

tianshu14:11:51

does next.jdbc has ddl support like java.jdbc?

seancorfield17:11:51

@U0NBGRGD6 no, but the DDL support in c.j.j. was very minimal -- just helpers to construct create/delete DDL strings. It wasn't worth adding those to next.jdbc.

seancorfield17:11:21

You can execute any DDL with next.jdbc, it just doesn't help you create those strings.

seancorfield17:11:58

@thenonameguy because of the way next.jdbc was designed and optimized for performance, neither a strict middleware approach nor a strict interceptor approach would work. If you look at what I've implemented, you'll see it's really part middleware and part interceptor: it wraps the connectable and the builder like middleware in order to provide four interception points (pre/post/row/resultset).