Dealing with spaces in DB and field names

I have a database with a schema like:

CREATE TABLE "Authorization Tokens" (
   "User Name" TEXT
);

I’m having trouble inserting a map into this table. What’s the JDBC line I want to insert some value into this table, given the spaces in table name and field name?

Assuming you’re using clojure.java.jdbc, http://clojure-doc.org/articles/ecosystem/java_jdbc/using_sql.html#clojure-identifiers-and-sql-entities – you want :entities (jdbc/quoted :ansi) (depending on the database you’re using – but you’re showing ".." which is ANSI style).

If you’re using next.jdbc, https://cljdoc.org/d/seancorfield/next.jdbc/1.0.0-alpha13/doc/getting-started/friendly-sql-functions#table--column-entity-names – you want :column-fn next.jdbc.quoted/ansi

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.