<< Back to previous view

[JDBC-5] Adding stropping and qualified identifiers to java.jdbc Created: 24/Apr/11  Updated: 01/Jun/16  Resolved: 09/Jul/11

Status: Closed
Project: java.jdbc
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Enhancement Priority: Minor
Reporter: Nicolas Buduroi Assignee: Nicolas Buduroi
Resolution: Completed Votes: 0
Labels: None

Attachments: Text File 0001-Added-the-with-stropping-macro-and-the-as-identifier.patch    
Patch: Code
Waiting On: Sean Corfield


Following the following discussion:


I've implemented a simple stropping feature that also provide a way to supply qualified identifiers and a function (as-identifier) that can be reused in user code. The implementation can be found there:


It's also attached to this issue.

Here's some example of how that feature could be used:

user> (create-table :foo [:bar :integer] [:baz :text])
"CREATE TABLE foo (bar integer, baz text)"
user> (create-table [:schema :foo] [:bar :integer] [:baz :text])
"CREATE TABLE schema.foo (bar integer, baz text)"
user> (with-stropping \" identity (create-table [:schema :foo] [:bar :integer] [:baz :text]))
"CREATE TABLE \"schema\".\"foo\" (\"bar\" integer, \"baz\" text)"
user> (with-stropping [[ ]] identity (create-table [:schema :foo] [:bar :integer] [:baz :text]))
"CREATE TABLE [schema].[foo] ([bar] integer, [baz] text)"

Comment by Sean Corfield [ 24/Apr/11 8:21 PM ]

Duplicate of https://github.com/clojure/java.jdbc/issues/7 - thanx for the patch!

Comment by Sean Corfield [ 09/Jul/11 2:28 PM ]

with-naming-strategy, with-quoted-identifiers, as-quoted-str address this.

Generated at Fri Jan 19 08:09:30 CST 2018 using JIRA 4.4#649-r158309.