Skip to content

Commit

Permalink
getSchemas(String, String) support & schema pattern matching
Browse files Browse the repository at this point in the history
  • Loading branch information
Destrolaric committed Feb 13, 2023
1 parent 6e59227 commit 5b4b2ad
Show file tree
Hide file tree
Showing 4 changed files with 208 additions and 131 deletions.
15 changes: 15 additions & 0 deletions src/main/java/org/sqlite/core/CoreDatabaseMetaData.java
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,21 @@ protected static String quote(String tableName) {
}
}

/**
* Escapes all wildcards, to prevent pattern matching for
* functions which should note support it
* @param val The string to escape
* @return The string with escaped wildcards
*/
protected static String escapeWildcards(final String val) {
if (val == null) {
return null;
}
String replacement = val.replace("%", "\\%");
replacement = replacement.replace("_", "\\_");
return replacement;
}

/**
* Applies SQL escapes for special characters in a given string.
*
Expand Down
Loading

0 comments on commit 5b4b2ad

Please sign in to comment.