gencow 0.1.20 → 0.1.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gencow",
3
- "version": "0.1.20",
3
+ "version": "0.1.21",
4
4
  "description": "Gencow — Backend OS for AI Agents",
5
5
  "type": "module",
6
6
  "bin": {
package/server/index.js CHANGED
@@ -71248,11 +71248,11 @@ function createAdminRoutes(db, rawSql, driver, getCtx, storage) {
71248
71248
  admin.get("/tables", async (c) => {
71249
71249
  let schemaName = "public";
71250
71250
  try {
71251
- const spRows = await rawSql(`SHOW search_path`);
71252
- const sp = spRows[0]?.search_path || "public";
71253
- const firstSchema = sp.split(",")[0].trim().replace(/"/g, "");
71254
- if (firstSchema && firstSchema !== '"$user"' && firstSchema !== "$user") {
71255
- schemaName = firstSchema;
71251
+ const spRows = await rawSql(`SELECT current_schemas(true) as schemas`);
71252
+ const schemas = spRows[0]?.schemas || [];
71253
+ const appSchema = schemas.find((s) => s.startsWith("app_"));
71254
+ if (appSchema) {
71255
+ schemaName = appSchema;
71256
71256
  }
71257
71257
  } catch {
71258
71258
  }