Fork me on GitHub
Drew Verlee02:05:58

Including the jdbc in my java project seems to have fixed the problem.

Drew Verlee02:05:36

Which I understand why that would fix the problem, but i’m a tad confused why it wasn’t already included. But i’m in uncharted territory with java interopt.

Drew Verlee03:05:00

somewhat offtopic though 🙂


What do you mean by "the jdbc"?

Drew Verlee03:05:46

right. I’m falling asleep over here. I meant including the postgres JDBC driver in my dependencies: - `

Drew Verlee03:05:47

gradle file:

dependencies {
    compile group: 'postgresql', name: 'postgresql', version: '9.0-801.jdbc4'
    compile files('/Users/drewverlee/personal/postgres-mock/fk-gen/target')


If your library had been a properly packaged artifact with a pom.xml, Gradle should have pulled in all its dependencies -- but you just used the JAR, right? Without the pom? And your JAR didn't have any of the transient dependencies?

Drew Verlee03:05:29

> just the Jar. Without the pom? Yep. just the uberjar. > And your JAR didn’t have any of the transient dependencies? I thought uberjars contained all the dependencies. I’m going to revisit this in the morning and read up on how to publish to my local maven repo and probably cover some very basic information on java dependency management, poms, maven, etc..


Are there any libraries there that would write DDLs and simple querys/inserts for me? I’ve seen Korma but I recall people suggested it was buggy?


For queries: korma works, but it's highly opinionated on how you managed your DB connections (i.e. globals) and makes it somewhat hard to validate the query plan. Personally, I think that is a solid choice for going from clojure data structures to queries, as is just writing the queries directly with . You might just try the raw though, for simple CRUD operations it's surprisingly effective


for generating DDLs: I'm not really aware of any clojure libraries that will actually generate the DDL's from a model, like what Django from python or ruby on rails will do for you


Thanks! HoneySQL looks nice, I never looked at it closely.


I think the fact that I’ve been used to Django creating DDLs for me has made me rusty on that aspect, and I want to avoid it - but perhaps adding indexes, constraints, generating index names and so on is a hassle and should be handled in a library.


I work at a site with a pretty decent amount of traffic ( , who's currently hiring clojure devs...), and I agree that managing the DDL's by hand is a hassle...but a necessary one to ensure performance


we actually use korma, honeysql, and hugsql, sometimes even within the same project. They all have certain areas where they excel, and so we try to use the right tool for the job whenever possible, and they play pretty well together


Yes, every time I needed to get some performance back I had to dive into Django’s docs to see how I can add complex indexes etc — but it’s still annoying to have to do it from the first minute.


@orestis you should learn to write sql for DDL operations, it's worth it. S-expressions offer no benefit there


ymmv but the more I use ORMs and automated tools, the more I want to have access to plain sql


imo insert/update is often simple and jdbc is often enough for the task


@myguidingstar The “basic” DDL stuff is not painful. It’s the constraints that come after that I find annoying, esp. for pretty basic stuff. I need to brush up again on the syntax though, perhaps there are some convenience that I have missed.


I do agree that the django model is super convenient though 🙂 , but once your project gets large enough, with enough need for performance, it gets in the way. @orestis if you ever need help or advice, feel free to ask. Either here, or a PM with me


My experience so far is that: Django can generate a pretty complex DDL for you, but sucks for complex queries. Ecto generates pretty limited DDLs but can generate nice queries (looks like a bit like HoneySQL).


Perhaps what I’m after is a boilerplate generator? I can take if from there 🙂


Some graphical tool that could give me 80% of my DDL that I could then tweak by hand, hmmmm.


DDL tends to be the most DB-specific aspect of SQL, which is why java.jdbc offers only the bare minimum (`create-table-ddl` -- where you're mostly on your own for how to specify the column types! -- and drop-table-ddl). And also why HoneySQL hasn't added support yet.


I agree with everyone here who said writing DDL by hand is a necessary skill since the variations are complex and you need to get it exactly right.


If you're using PostgreSQL, I believe there's an extension library for HoneySQL that supports DDL? @orestis


honeysql-postgres supports a lot of the DDL


I haven't used it for its ddl support, but it does register several other sql extensions like support for INSERT ... ON CONFLICT ...


Ah, I will check it out @seancorfield — thanks!