Mercurial > hg > monetdb-java
comparison src/main/java/org/monetdb/util/SQLExporter.java @ 901:73f25cb71e4f
Adapt table DDL generator to deal with new UNIQUE NULLS NOT DISTINCT key_type.
author | Martin van Dinther <martin.van.dinther@monetdbsolutions.com> |
---|---|
date | Thu, 30 May 2024 19:06:20 +0200 (11 months ago) |
parents | e890195256ac |
children | d416e9b6b3d0 |
comparison
equal
deleted
inserted
replaced
900:be8476c1acec | 901:73f25cb71e4f |
---|---|
214 colNmIndex = cols.findColumn("COLUMN_NAME"); | 214 colNmIndex = cols.findColumn("COLUMN_NAME"); |
215 while (cols.next()) { | 215 while (cols.next()) { |
216 final String idxname = cols.getString(colIndexNm); | 216 final String idxname = cols.getString(colIndexNm); |
217 if (idxname != null && !idxname.endsWith("_pkey")) { | 217 if (idxname != null && !idxname.endsWith("_pkey")) { |
218 out.println(","); | 218 out.println(","); |
219 out.print("\tCONSTRAINT " + dq(idxname) + " UNIQUE (" + dq(cols.getString(colNmIndex))); | 219 out.print("\tCONSTRAINT " + dq(idxname)); |
220 if (idxname.endsWith("_nndunique")) | |
221 out.print(" UNIQUE NULLS NOT DISTINCT ("); // new since release 11.50 (Aug2024) | |
222 else | |
223 out.print(" UNIQUE ("); | |
224 out.print(dq(cols.getString(colNmIndex))); | |
220 | 225 |
221 boolean next; | 226 boolean next; |
222 while ((next = cols.next()) && idxname.equals(cols.getString(colIndexNm))) { | 227 while ((next = cols.next()) && idxname.equals(cols.getString(colIndexNm))) { |
223 out.print(", " + dq(cols.getString(colNmIndex))); | 228 out.print(", " + dq(cols.getString(colNmIndex))); |
224 } | 229 } |