From 55a093555d757d9bbbf2d75bb1d551eab1b56216 Mon Sep 17 00:00:00 2001 From: Artem Shubovych Date: Tue, 22 Oct 2024 14:17:44 +1100 Subject: [PATCH] Add support for default SQLite schemas --- src/main/java/org/sqlite/jdbc3/JDBC3DatabaseMetaData.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/sqlite/jdbc3/JDBC3DatabaseMetaData.java b/src/main/java/org/sqlite/jdbc3/JDBC3DatabaseMetaData.java index 086fcbc000..b8962c1219 100644 --- a/src/main/java/org/sqlite/jdbc3/JDBC3DatabaseMetaData.java +++ b/src/main/java/org/sqlite/jdbc3/JDBC3DatabaseMetaData.java @@ -704,7 +704,7 @@ public boolean supportsSchemasInProcedureCalls() { /** @see java.sql.DatabaseMetaData#supportsSchemasInTableDefinitions() */ public boolean supportsSchemasInTableDefinitions() { - return false; + return true; } /** @see java.sql.DatabaseMetaData#supportsSelectForUpdate() */ @@ -1182,7 +1182,9 @@ public ResultSet getSchemas() throws SQLException { if (getSchemas == null) { getSchemas = conn.prepareStatement( - "select null as TABLE_SCHEM, null as TABLE_CATALOG limit 0;"); + "SELECT NULL AS TABLE_CATALOG, 'main' AS TABLE_SCHEM" + + " UNION ALL " + + "SELECT NULL AS TABLE_CATALOG, 'test' AS TABLE_SCHEM;"); } return getSchemas.executeQuery();