Hi guys. I have started coding in Ktor. I need som...
# server
i
Hi guys. I have started coding in Ktor. I need some good SQL query builder (not ORM) to create table and update columns in runtime. Since Exposed is statically typed, they don't support adding columns in runtime and also querying things in run time (where I don't know which column I am going to query in the first place). Is there any good library which will reduce my pain of writing raw SQL queries and help me to reduce human error? I have found https://github.com/darkredz/Zeko-SQL-Builder . This does not support creating or updating the table schema.
g
https://www.jooq.org/ if you use postgres/mysql
👍 2
i
I will give it a try. But it seems very heavy. 78 MB
o
r
I would agree with jOOQ - the jar I have for it is 4.6MB, not 78 - the 78MB zip also contains the source, javadoc and all the extension libraries
g
yes im not sure where 78mb comes from. Also to clarify, jooq works with all dbs (relational) but is free for the open source ones. Its one of the best libraries in the whole JVM space for me.
i
Thanks for all your response. My use case is that. A user (id = 765) signs up in my application. He chooses Product module template (which contains Product name, price, quantity_available). Then he also wants to customize the module by adding one more column which is, let's say, "max_discount_on_friday". Now in my database, I will have to create a table like this: CREATE TABLE USER_765_Product ( id SERIAL PRIMARY KEY, product_name VARCHAR(255) NOT NULL, price DECIMAL(10, 2) NOT NULL, quantity_available INT NOT NULL, max_discount_on_friday DECIMAL(5, 2), ); Also the user can query based on discount/price/name or whatnot. So the querying as well becomes fully dynamic and there is no Static Schema whatsoever.
y
If you want something for kotlin native look here: https://github.com/smyrgeorge/sqlx4k
i
Thank you Yorgos!
🙌 1
k
is relational db what you want?
i
Yes I want a relational DB @kqr
d
We use #C03JF82SDHA, and its very nice and well supported
gratitude thank you 1