@elizaos/plugin-sql 1.0.8 → 1.0.9

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/dist/index.js CHANGED
@@ -1677,7 +1677,7 @@ var BaseDrizzleAdapter = class extends DatabaseAdapter {
1677
1677
  roomId: memory.roomId,
1678
1678
  worldId: memory.worldId,
1679
1679
  // Include worldId
1680
- agentId: this.agentId,
1680
+ agentId: memory.agentId || this.agentId,
1681
1681
  unique: memory.unique ?? isUnique,
1682
1682
  createdAt: memory.createdAt ? new Date(memory.createdAt) : /* @__PURE__ */ new Date()
1683
1683
  }
@@ -3839,9 +3839,11 @@ var PluginNamespaceManager = class {
3839
3839
  const result = await this.db.execute(sql17.raw("SHOW search_path"));
3840
3840
  if (result.rows && result.rows.length > 0) {
3841
3841
  const searchPath = result.rows[0].search_path;
3842
- const firstSchema = searchPath.split(",")[0].trim();
3843
- if (firstSchema && firstSchema !== '"$user"') {
3844
- return firstSchema;
3842
+ const schemas = searchPath.split(",").map((s) => s.trim());
3843
+ for (const schema of schemas) {
3844
+ if (schema && !schema.includes("$user")) {
3845
+ return schema;
3846
+ }
3845
3847
  }
3846
3848
  }
3847
3849
  } catch (e) {