Skip to content

Commit 5b4b2ad

Browse files
committed
getSchemas(String, String) support & schema pattern matching
1 parent 6e59227 commit 5b4b2ad

File tree

4 files changed

+208
-131
lines changed

4 files changed

+208
-131
lines changed

src/main/java/org/sqlite/core/CoreDatabaseMetaData.java

+15
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,21 @@ protected static String quote(String tableName) {
163163
}
164164
}
165165

166+
/**
167+
* Escapes all wildcards, to prevent pattern matching for
168+
* functions which should note support it
169+
* @param val The string to escape
170+
* @return The string with escaped wildcards
171+
*/
172+
protected static String escapeWildcards(final String val) {
173+
if (val == null) {
174+
return null;
175+
}
176+
String replacement = val.replace("%", "\\%");
177+
replacement = replacement.replace("_", "\\_");
178+
return replacement;
179+
}
180+
166181
/**
167182
* Applies SQL escapes for special characters in a given string.
168183
*

0 commit comments

Comments
 (0)