Fork me on GitHub

What is the preferred way to keep your sql statements organized with


I enjoyed using conman and keeping my sql in a .sql file with the previous iteration of the library, but it doesn't look like conman supports



๐Ÿ‘ 8

I'll give a :thumbsup::skin-tone-2: to HugSQL as it has built-in support for next.jdbc -- and it's also documented as part of the next.jdbc documentation

๐Ÿ˜„ 4

hi -- does anyone have a working example of a db-spec that connects to ms sql server? I'm on a linux box trying to connect using and keep getting authentication failures. I've tried setting :user to "DOMAIN\\username" and just "username", as well as something simillar in :subname. what's the syntax for using domain AD authentication in jdbc?


^ @mbarillier Use the :dbtype/`:dbname` approach instead of trying to construct things with :subname etc.


next.jdbc assumes default host/port locally, uses :host/`:port` because that's an artifact of the different ways I test those two libraries (with I used a SQL Server Express instance running on an old Windows XP VM on my Mac; with next.jdbc I used Microsoft's official SQL Server Docker image based on Linux and exposed the host/port as


Not sure how you'd do AD authentication if that's different from regular user/password.


@seancorfield lol ... neither do I ๐Ÿ™‚


The alternative is to construct the full JDBC URL yourself, based on whatever information you can find out there for how to connect via AD auth to SQL Server, and give that to c.j.j (or next.jdbc).


AD is integrated security and based on the current logged in user right?


Been a while since my .NET days


@dpsutton yes, there's an integratedSecurity=true option on the connect string, but works only on windows (I'm on linux)


Can you try using that connection string from a more traditional client? Iโ€™m guessing it wonโ€™t work from Linux at all


I got it to work using a connect string, something like: "jdbc:<sqlserver://HOST>:PORT;databaseName=DBNAME;user=ID;password=PWD". I don't understand how this active directory authentication works, but apparently the service account I used doesn't require a domain, but mine does. microsoft products are a nightmare (IMHO).


@mbarillier Given that URL works, I would expect a db-spec map of

{:dbtype "sqlserver"
 :dbname "DBNAME"
 :host "HOST"
 :port PORT
 :user "ID"
 :password "PWD"}
to work also


(and that should work with both or next.jdbc -- and I'd encourage you to use the latter if you are just getting started)