@elizaos/plugin-sql 1.0.0-beta.49 → 1.0.0-beta.50

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.
@@ -0,0 +1,2 @@
1
+
2
+ export { }
package/dist/migrate.js CHANGED
@@ -23,7 +23,7 @@ async function runMigrations() {
23
23
  process.exit(1);
24
24
  }
25
25
  } else {
26
- let elizaDbDir = process.env.PGLITE_DATA_DIR;
26
+ let elizaDbDir = process.env.PGLITE_DATA_DIR ?? path.join(os.homedir(), ".eliza", stringToUuid(process.cwd()), "pglite");
27
27
  if (!elizaDbDir) {
28
28
  const homeDir = os.homedir();
29
29
  const elizaDir = path.join(homeDir, ".eliza");
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/migrate.ts"],"sourceRoot":"./","sourcesContent":["import { logger, stringToUuid } from '@elizaos/core';\nimport { config } from 'dotenv';\nimport { PGliteClientManager } from './pglite/manager.js';\nimport { PostgresConnectionManager } from './pg/manager.js';\nimport os from 'node:os';\nimport path from 'node:path';\n\nconfig({ path: '../../.env' });\n\n/**\n * Executes database migrations using either PostgreSQL or PGlite, depending on environment configuration.\n *\n * If the `POSTGRES_URL` environment variable is set, migrations are run against the specified PostgreSQL database. Otherwise, migrations are run using a PGlite database, with the data directory determined by the `PGLITE_DATA_DIR` environment variable or a project-specific default path.\n *\n * @remark This function terminates the Node.js process upon completion or failure.\n */\nasync function runMigrations() {\n if (process.env.POSTGRES_URL) {\n try {\n const connectionManager = new PostgresConnectionManager(process.env.POSTGRES_URL);\n await connectionManager.initialize();\n await connectionManager.runMigrations();\n // await connectionManager.close();\n logger.success('PostgreSQL migrations completed successfully');\n process.exit(0);\n } catch (error) {\n logger.warn('PostgreSQL migration failed:', error);\n process.exit(1);\n }\n } else {\n let elizaDbDir = process.env.PGLITE_DATA_DIR;\n if (!elizaDbDir) {\n const homeDir = os.homedir();\n const elizaDir = path.join(homeDir, '.eliza');\n // Construct project-specific path\n elizaDbDir = path.join(elizaDir, 'projects', stringToUuid(process.cwd()), 'pglite');\n logger.info(`PGLITE_DATA_DIR not set, defaulting to project-specific path: ${elizaDbDir}`);\n } else {\n logger.info(`Using PGLITE_DATA_DIR: ${elizaDbDir}`);\n }\n\n logger.info('Using PGlite database at:', elizaDbDir);\n const clientManager = new PGliteClientManager({\n dataDir: elizaDbDir,\n });\n\n try {\n await clientManager.initialize();\n await clientManager.runMigrations();\n logger.success('PGlite migrations completed successfully');\n await clientManager.close();\n process.exit(0);\n } catch (error) {\n logger.error('PGlite migration failed:', error);\n try {\n await clientManager.close();\n } catch (closeError) {\n logger.error('Failed to close PGlite connection:', closeError);\n }\n process.exit(1);\n }\n }\n}\n\nrunMigrations().catch((error) => {\n logger.error('Unhandled error in migrations:', error);\n process.exit(1);\n});\n"],"mappings":";;;;;;;AAAA,SAAS,QAAQ,oBAAoB;AACrC,SAAS,cAAc;AAGvB,OAAO,QAAQ;AACf,OAAO,UAAU;AAEjB,OAAO,EAAE,MAAM,aAAa,CAAC;AAS7B,eAAe,gBAAgB;AAC7B,MAAI,QAAQ,IAAI,cAAc;AAC5B,QAAI;AACF,YAAM,oBAAoB,IAAI,0BAA0B,QAAQ,IAAI,YAAY;AAChF,YAAM,kBAAkB,WAAW;AACnC,YAAM,kBAAkB,cAAc;AAEtC,aAAO,QAAQ,8CAA8C;AAC7D,cAAQ,KAAK,CAAC;AAAA,IAChB,SAAS,OAAO;AACd,aAAO,KAAK,gCAAgC,KAAK;AACjD,cAAQ,KAAK,CAAC;AAAA,IAChB;AAAA,EACF,OAAO;AACL,QAAI,aAAa,QAAQ,IAAI;AAC7B,QAAI,CAAC,YAAY;AACf,YAAM,UAAU,GAAG,QAAQ;AAC3B,YAAM,WAAW,KAAK,KAAK,SAAS,QAAQ;AAE5C,mBAAa,KAAK,KAAK,UAAU,YAAY,aAAa,QAAQ,IAAI,CAAC,GAAG,QAAQ;AAClF,aAAO,KAAK,iEAAiE,UAAU,EAAE;AAAA,IAC3F,OAAO;AACL,aAAO,KAAK,0BAA0B,UAAU,EAAE;AAAA,IACpD;AAEA,WAAO,KAAK,6BAA6B,UAAU;AACnD,UAAM,gBAAgB,IAAI,oBAAoB;AAAA,MAC5C,SAAS;AAAA,IACX,CAAC;AAED,QAAI;AACF,YAAM,cAAc,WAAW;AAC/B,YAAM,cAAc,cAAc;AAClC,aAAO,QAAQ,0CAA0C;AACzD,YAAM,cAAc,MAAM;AAC1B,cAAQ,KAAK,CAAC;AAAA,IAChB,SAAS,OAAO;AACd,aAAO,MAAM,4BAA4B,KAAK;AAC9C,UAAI;AACF,cAAM,cAAc,MAAM;AAAA,MAC5B,SAAS,YAAY;AACnB,eAAO,MAAM,sCAAsC,UAAU;AAAA,MAC/D;AACA,cAAQ,KAAK,CAAC;AAAA,IAChB;AAAA,EACF;AACF;AA9Ce;AAgDf,cAAc,EAAE,MAAM,CAAC,UAAU;AAC/B,SAAO,MAAM,kCAAkC,KAAK;AACpD,UAAQ,KAAK,CAAC;AAChB,CAAC;","names":[]}
1
+ {"version":3,"sources":["../src/migrate.ts"],"sourceRoot":"./","sourcesContent":["import { logger, stringToUuid } from '@elizaos/core';\nimport { config } from 'dotenv';\nimport { PGliteClientManager } from './pglite/manager.js';\nimport { PostgresConnectionManager } from './pg/manager.js';\nimport os from 'node:os';\nimport path from 'node:path';\n\nconfig({ path: '../../.env' });\n\n/**\n * Executes database migrations using either PostgreSQL or PGlite, depending on environment configuration.\n *\n * If the `POSTGRES_URL` environment variable is set, migrations are run against the specified PostgreSQL database. Otherwise, migrations are run using a PGlite database, with the data directory determined by the `PGLITE_DATA_DIR` environment variable or a project-specific default path.\n *\n * @remark This function terminates the Node.js process upon completion or failure.\n */\nasync function runMigrations() {\n if (process.env.POSTGRES_URL) {\n try {\n const connectionManager = new PostgresConnectionManager(process.env.POSTGRES_URL);\n await connectionManager.initialize();\n await connectionManager.runMigrations();\n // await connectionManager.close();\n logger.success('PostgreSQL migrations completed successfully');\n process.exit(0);\n } catch (error) {\n logger.warn('PostgreSQL migration failed:', error);\n process.exit(1);\n }\n } else {\n let elizaDbDir =\n process.env.PGLITE_DATA_DIR ??\n path.join(os.homedir(), '.eliza', stringToUuid(process.cwd()), 'pglite');\n if (!elizaDbDir) {\n const homeDir = os.homedir();\n const elizaDir = path.join(homeDir, '.eliza');\n // Construct project-specific path\n elizaDbDir = path.join(elizaDir, 'projects', stringToUuid(process.cwd()), 'pglite');\n logger.info(`PGLITE_DATA_DIR not set, defaulting to project-specific path: ${elizaDbDir}`);\n } else {\n logger.info(`Using PGLITE_DATA_DIR: ${elizaDbDir}`);\n }\n\n logger.info('Using PGlite database at:', elizaDbDir);\n const clientManager = new PGliteClientManager({\n dataDir: elizaDbDir,\n });\n\n try {\n await clientManager.initialize();\n await clientManager.runMigrations();\n logger.success('PGlite migrations completed successfully');\n await clientManager.close();\n process.exit(0);\n } catch (error) {\n logger.error('PGlite migration failed:', error);\n try {\n await clientManager.close();\n } catch (closeError) {\n logger.error('Failed to close PGlite connection:', closeError);\n }\n process.exit(1);\n }\n }\n}\n\nrunMigrations().catch((error) => {\n logger.error('Unhandled error in migrations:', error);\n process.exit(1);\n});\n"],"mappings":";;;;;;;AAAA,SAAS,QAAQ,oBAAoB;AACrC,SAAS,cAAc;AAGvB,OAAO,QAAQ;AACf,OAAO,UAAU;AAEjB,OAAO,EAAE,MAAM,aAAa,CAAC;AAS7B,eAAe,gBAAgB;AAC7B,MAAI,QAAQ,IAAI,cAAc;AAC5B,QAAI;AACF,YAAM,oBAAoB,IAAI,0BAA0B,QAAQ,IAAI,YAAY;AAChF,YAAM,kBAAkB,WAAW;AACnC,YAAM,kBAAkB,cAAc;AAEtC,aAAO,QAAQ,8CAA8C;AAC7D,cAAQ,KAAK,CAAC;AAAA,IAChB,SAAS,OAAO;AACd,aAAO,KAAK,gCAAgC,KAAK;AACjD,cAAQ,KAAK,CAAC;AAAA,IAChB;AAAA,EACF,OAAO;AACL,QAAI,aACF,QAAQ,IAAI,mBACZ,KAAK,KAAK,GAAG,QAAQ,GAAG,UAAU,aAAa,QAAQ,IAAI,CAAC,GAAG,QAAQ;AACzE,QAAI,CAAC,YAAY;AACf,YAAM,UAAU,GAAG,QAAQ;AAC3B,YAAM,WAAW,KAAK,KAAK,SAAS,QAAQ;AAE5C,mBAAa,KAAK,KAAK,UAAU,YAAY,aAAa,QAAQ,IAAI,CAAC,GAAG,QAAQ;AAClF,aAAO,KAAK,iEAAiE,UAAU,EAAE;AAAA,IAC3F,OAAO;AACL,aAAO,KAAK,0BAA0B,UAAU,EAAE;AAAA,IACpD;AAEA,WAAO,KAAK,6BAA6B,UAAU;AACnD,UAAM,gBAAgB,IAAI,oBAAoB;AAAA,MAC5C,SAAS;AAAA,IACX,CAAC;AAED,QAAI;AACF,YAAM,cAAc,WAAW;AAC/B,YAAM,cAAc,cAAc;AAClC,aAAO,QAAQ,0CAA0C;AACzD,YAAM,cAAc,MAAM;AAC1B,cAAQ,KAAK,CAAC;AAAA,IAChB,SAAS,OAAO;AACd,aAAO,MAAM,4BAA4B,KAAK;AAC9C,UAAI;AACF,cAAM,cAAc,MAAM;AAAA,MAC5B,SAAS,YAAY;AACnB,eAAO,MAAM,sCAAsC,UAAU;AAAA,MAC/D;AACA,cAAQ,KAAK,CAAC;AAAA,IAChB;AAAA,EACF;AACF;AAhDe;AAkDf,cAAc,EAAE,MAAM,CAAC,UAAU;AAC/B,SAAO,MAAM,kCAAkC,KAAK;AACpD,UAAQ,KAAK,CAAC;AAChB,CAAC;","names":[]}
@@ -1,3 +1,4 @@
1
1
  CREATE EXTENSION IF NOT EXISTS vector;
2
- --> statement-breakpoint
3
- CREATE EXTENSION IF NOT EXISTS fuzzystrmatch;
2
+ --> statement-breakpoint
3
+ CREATE EXTENSION IF NOT EXISTS fuzzystrmatch;
4
+ --> statement-breakpoint
@@ -1,23 +1,25 @@
1
- CREATE EXTENSION IF NOT EXISTS vector;--> statement-breakpoint
2
- CREATE EXTENSION IF NOT EXISTS fuzzystrmatch;--> statement-breakpoint
1
+ CREATE EXTENSION IF NOT EXISTS vector;
2
+ --> statement-breakpoint
3
+ CREATE EXTENSION IF NOT EXISTS fuzzystrmatch;
4
+ --> statement-breakpoint
3
5
 
4
6
  CREATE TABLE "agents" (
5
7
  "id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
6
8
  "enabled" boolean DEFAULT true NOT NULL,
7
9
  "createdAt" timestamptz DEFAULT now() NOT NULL,
8
10
  "updatedAt" timestamptz DEFAULT now() NOT NULL,
9
- "name" text,
11
+ "name" text NOT NULL,
10
12
  "username" text,
11
- "system" text,
12
- "bio" jsonb NOT NULL,
13
- "message_examples" jsonb DEFAULT '[]'::jsonb,
14
- "post_examples" jsonb DEFAULT '[]'::jsonb,
15
- "topics" jsonb DEFAULT '[]'::jsonb,
16
- "adjectives" jsonb DEFAULT '[]'::jsonb,
17
- "knowledge" jsonb DEFAULT '[]'::jsonb,
18
- "plugins" jsonb DEFAULT '[]'::jsonb,
19
- "settings" jsonb DEFAULT '{}'::jsonb,
20
- "style" jsonb DEFAULT '{}'::jsonb,
13
+ "system" text DEFAULT '',
14
+ "bio" jsonb DEFAULT '[]'::jsonb NOT NULL,
15
+ "message_examples" jsonb DEFAULT '[]'::jsonb NOT NULL,
16
+ "post_examples" jsonb DEFAULT '[]'::jsonb NOT NULL,
17
+ "topics" jsonb DEFAULT '[]'::jsonb NOT NULL,
18
+ "adjectives" jsonb DEFAULT '[]'::jsonb NOT NULL,
19
+ "knowledge" jsonb DEFAULT '[]'::jsonb NOT NULL,
20
+ "plugins" jsonb DEFAULT '[]'::jsonb NOT NULL,
21
+ "settings" jsonb DEFAULT '{}'::jsonb NOT NULL,
22
+ "style" jsonb DEFAULT '{}'::jsonb NOT NULL,
21
23
  CONSTRAINT "name_unique" UNIQUE("name")
22
24
  );
23
25
  --> statement-breakpoint
@@ -60,8 +62,8 @@ CREATE TABLE "entities" (
60
62
  "id" uuid PRIMARY KEY NOT NULL,
61
63
  "agentId" uuid NOT NULL,
62
64
  "createdAt" timestamptz DEFAULT now() NOT NULL,
63
- "names" text[] DEFAULT '{}'::text[],
64
- "metadata" jsonb DEFAULT '{}'::jsonb,
65
+ "names" text[] DEFAULT '{}'::text[] NOT NULL,
66
+ "metadata" jsonb DEFAULT '{}'::jsonb NOT NULL,
65
67
  CONSTRAINT "id_agent_id_unique" UNIQUE("id","agentId")
66
68
  );
67
69
  --> statement-breakpoint
@@ -80,7 +82,7 @@ CREATE TABLE "memories" (
80
82
  "createdAt" timestamptz DEFAULT now() NOT NULL,
81
83
  "content" jsonb NOT NULL,
82
84
  "entityId" uuid,
83
- "agentId" uuid,
85
+ "agentId" uuid NOT NULL,
84
86
  "roomId" uuid,
85
87
  "worldId" uuid,
86
88
  "unique" boolean DEFAULT true NOT NULL,
@@ -138,14 +140,15 @@ CREATE TABLE "rooms" (
138
140
  CREATE TABLE "tasks" (
139
141
  "id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
140
142
  "name" text NOT NULL,
141
- "description" text NOT NULL,
142
- "room_id" uuid,
143
- "world_id" uuid,
143
+ "description" text,
144
+ "roomId" uuid,
145
+ "worldId" uuid,
146
+ "entityId" uuid,
144
147
  "agent_id" uuid NOT NULL,
145
- "tags" text[],
146
- "metadata" jsonb,
147
- "created_at" timestamp DEFAULT now(),
148
- "updated_at" timestamp DEFAULT now()
148
+ "tags" text[] DEFAULT '{}'::text[],
149
+ "metadata" jsonb DEFAULT '{}'::jsonb,
150
+ "created_at" timestamp with time zone DEFAULT now(),
151
+ "updated_at" timestamp with time zone DEFAULT now()
149
152
  );
150
153
  --> statement-breakpoint
151
154
  CREATE TABLE "worlds" (
@@ -167,17 +170,15 @@ ALTER TABLE "embeddings" ADD CONSTRAINT "embeddings_memory_id_memories_id_fk" FO
167
170
  ALTER TABLE "embeddings" ADD CONSTRAINT "fk_embedding_memory" FOREIGN KEY ("memory_id") REFERENCES "public"."memories"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
168
171
  ALTER TABLE "entities" ADD CONSTRAINT "entities_agentId_agents_id_fk" FOREIGN KEY ("agentId") REFERENCES "public"."agents"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
169
172
  ALTER TABLE "logs" ADD CONSTRAINT "logs_entityId_entities_id_fk" FOREIGN KEY ("entityId") REFERENCES "public"."entities"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
170
- ALTER TABLE "logs" ADD CONSTRAINT "logs_roomId_rooms_id_fk" FOREIGN KEY ("roomId") REFERENCES "public"."rooms"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
173
+ ALTER TABLE "logs" ADD CONSTRAINT "logs_roomId_rooms_id_fk" FOREIGN KEY ("roomId") REFERENCES "public"."rooms"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
171
174
  ALTER TABLE "logs" ADD CONSTRAINT "fk_room" FOREIGN KEY ("roomId") REFERENCES "public"."rooms"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
172
175
  ALTER TABLE "logs" ADD CONSTRAINT "fk_user" FOREIGN KEY ("entityId") REFERENCES "public"."entities"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
173
176
  ALTER TABLE "memories" ADD CONSTRAINT "memories_entityId_entities_id_fk" FOREIGN KEY ("entityId") REFERENCES "public"."entities"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
174
177
  ALTER TABLE "memories" ADD CONSTRAINT "memories_agentId_agents_id_fk" FOREIGN KEY ("agentId") REFERENCES "public"."agents"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
175
178
  ALTER TABLE "memories" ADD CONSTRAINT "memories_roomId_rooms_id_fk" FOREIGN KEY ("roomId") REFERENCES "public"."rooms"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
176
- ALTER TABLE "memories" ADD CONSTRAINT "memories_worldId_worlds_id_fk" FOREIGN KEY ("worldId") REFERENCES "public"."worlds"("id") ON DELETE set null ON UPDATE no action;--> statement-breakpoint
177
179
  ALTER TABLE "memories" ADD CONSTRAINT "fk_room" FOREIGN KEY ("roomId") REFERENCES "public"."rooms"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
178
180
  ALTER TABLE "memories" ADD CONSTRAINT "fk_user" FOREIGN KEY ("entityId") REFERENCES "public"."entities"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
179
181
  ALTER TABLE "memories" ADD CONSTRAINT "fk_agent" FOREIGN KEY ("agentId") REFERENCES "public"."agents"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
180
- ALTER TABLE "memories" ADD CONSTRAINT "fk_world" FOREIGN KEY ("worldId") REFERENCES "public"."worlds"("id") ON DELETE set null ON UPDATE no action;--> statement-breakpoint
181
182
  ALTER TABLE "participants" ADD CONSTRAINT "participants_entityId_entities_id_fk" FOREIGN KEY ("entityId") REFERENCES "public"."entities"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
182
183
  ALTER TABLE "participants" ADD CONSTRAINT "participants_roomId_rooms_id_fk" FOREIGN KEY ("roomId") REFERENCES "public"."rooms"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
183
184
  ALTER TABLE "participants" ADD CONSTRAINT "participants_agentId_agents_id_fk" FOREIGN KEY ("agentId") REFERENCES "public"."agents"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
@@ -189,7 +190,6 @@ ALTER TABLE "relationships" ADD CONSTRAINT "relationships_agentId_agents_id_fk"
189
190
  ALTER TABLE "relationships" ADD CONSTRAINT "fk_user_a" FOREIGN KEY ("sourceEntityId") REFERENCES "public"."entities"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
190
191
  ALTER TABLE "relationships" ADD CONSTRAINT "fk_user_b" FOREIGN KEY ("targetEntityId") REFERENCES "public"."entities"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
191
192
  ALTER TABLE "rooms" ADD CONSTRAINT "rooms_agentId_agents_id_fk" FOREIGN KEY ("agentId") REFERENCES "public"."agents"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
192
- ALTER TABLE "rooms" ADD CONSTRAINT "rooms_worldId_worlds_id_fk" FOREIGN KEY ("worldId") REFERENCES "public"."worlds"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
193
193
  ALTER TABLE "worlds" ADD CONSTRAINT "worlds_agentId_agents_id_fk" FOREIGN KEY ("agentId") REFERENCES "public"."agents"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
194
194
  CREATE INDEX "idx_embedding_memory" ON "embeddings" USING btree ("memory_id");--> statement-breakpoint
195
195
  CREATE INDEX "idx_memories_type_room" ON "memories" USING btree ("type","roomId");--> statement-breakpoint
@@ -1,5 +1,5 @@
1
1
  {
2
- "id": "8d7ae0aa-76b7-4e80-9133-db45fb9b6d1e",
2
+ "id": "327f7a6a-2e61-4e4c-9604-242dc5fd42d4",
3
3
  "prevId": "00000000-0000-0000-0000-000000000000",
4
4
  "version": "7",
5
5
  "dialect": "postgresql",
@@ -40,7 +40,7 @@
40
40
  "name": "name",
41
41
  "type": "text",
42
42
  "primaryKey": false,
43
- "notNull": false
43
+ "notNull": true
44
44
  },
45
45
  "username": {
46
46
  "name": "username",
@@ -52,68 +52,68 @@
52
52
  "name": "system",
53
53
  "type": "text",
54
54
  "primaryKey": false,
55
- "notNull": false
55
+ "default": ""
56
56
  },
57
57
  "bio": {
58
58
  "name": "bio",
59
59
  "type": "jsonb",
60
60
  "primaryKey": false,
61
- "notNull": true
61
+ "default": "[]::jsonb"
62
62
  },
63
63
  "message_examples": {
64
64
  "name": "message_examples",
65
65
  "type": "jsonb",
66
66
  "primaryKey": false,
67
- "notNull": false,
67
+ "notNull": true,
68
68
  "default": "'[]'::jsonb"
69
69
  },
70
70
  "post_examples": {
71
71
  "name": "post_examples",
72
72
  "type": "jsonb",
73
73
  "primaryKey": false,
74
- "notNull": false,
74
+ "notNull": true,
75
75
  "default": "'[]'::jsonb"
76
76
  },
77
77
  "topics": {
78
78
  "name": "topics",
79
79
  "type": "jsonb",
80
80
  "primaryKey": false,
81
- "notNull": false,
81
+ "notNull": true,
82
82
  "default": "'[]'::jsonb"
83
83
  },
84
84
  "adjectives": {
85
85
  "name": "adjectives",
86
86
  "type": "jsonb",
87
87
  "primaryKey": false,
88
- "notNull": false,
88
+ "notNull": true,
89
89
  "default": "'[]'::jsonb"
90
90
  },
91
91
  "knowledge": {
92
92
  "name": "knowledge",
93
93
  "type": "jsonb",
94
94
  "primaryKey": false,
95
- "notNull": false,
95
+ "notNull": true,
96
96
  "default": "'[]'::jsonb"
97
97
  },
98
98
  "plugins": {
99
99
  "name": "plugins",
100
100
  "type": "jsonb",
101
101
  "primaryKey": false,
102
- "notNull": false,
102
+ "notNull": true,
103
103
  "default": "'[]'::jsonb"
104
104
  },
105
105
  "settings": {
106
106
  "name": "settings",
107
107
  "type": "jsonb",
108
108
  "primaryKey": false,
109
- "notNull": false,
109
+ "notNull": true,
110
110
  "default": "'{}'::jsonb"
111
111
  },
112
112
  "style": {
113
113
  "name": "style",
114
114
  "type": "jsonb",
115
115
  "primaryKey": false,
116
- "notNull": false,
116
+ "notNull": true,
117
117
  "default": "'{}'::jsonb"
118
118
  }
119
119
  },
@@ -450,14 +450,14 @@
450
450
  "name": "names",
451
451
  "type": "text[]",
452
452
  "primaryKey": false,
453
- "notNull": false,
453
+ "notNull": true,
454
454
  "default": "'{}'::text[]"
455
455
  },
456
456
  "metadata": {
457
457
  "name": "metadata",
458
458
  "type": "jsonb",
459
459
  "primaryKey": false,
460
- "notNull": false,
460
+ "notNull": true,
461
461
  "default": "'{}'::jsonb"
462
462
  }
463
463
  },
@@ -545,7 +545,7 @@
545
545
  "tableTo": "rooms",
546
546
  "columnsFrom": ["roomId"],
547
547
  "columnsTo": ["id"],
548
- "onDelete": "no action",
548
+ "onDelete": "cascade",
549
549
  "onUpdate": "no action"
550
550
  },
551
551
  "fk_room": {
@@ -612,7 +612,7 @@
612
612
  "name": "agentId",
613
613
  "type": "uuid",
614
614
  "primaryKey": false,
615
- "notNull": false
615
+ "notNull": true
616
616
  },
617
617
  "roomId": {
618
618
  "name": "roomId",
@@ -758,15 +758,6 @@
758
758
  "onDelete": "cascade",
759
759
  "onUpdate": "no action"
760
760
  },
761
- "memories_worldId_worlds_id_fk": {
762
- "name": "memories_worldId_worlds_id_fk",
763
- "tableFrom": "memories",
764
- "tableTo": "worlds",
765
- "columnsFrom": ["worldId"],
766
- "columnsTo": ["id"],
767
- "onDelete": "set null",
768
- "onUpdate": "no action"
769
- },
770
761
  "fk_room": {
771
762
  "name": "fk_room",
772
763
  "tableFrom": "memories",
@@ -793,15 +784,6 @@
793
784
  "columnsTo": ["id"],
794
785
  "onDelete": "cascade",
795
786
  "onUpdate": "no action"
796
- },
797
- "fk_world": {
798
- "name": "fk_world",
799
- "tableFrom": "memories",
800
- "tableTo": "worlds",
801
- "columnsFrom": ["worldId"],
802
- "columnsTo": ["id"],
803
- "onDelete": "set null",
804
- "onUpdate": "no action"
805
787
  }
806
788
  },
807
789
  "compositePrimaryKeys": {},
@@ -1155,15 +1137,6 @@
1155
1137
  "columnsTo": ["id"],
1156
1138
  "onDelete": "cascade",
1157
1139
  "onUpdate": "no action"
1158
- },
1159
- "rooms_worldId_worlds_id_fk": {
1160
- "name": "rooms_worldId_worlds_id_fk",
1161
- "tableFrom": "rooms",
1162
- "tableTo": "worlds",
1163
- "columnsFrom": ["worldId"],
1164
- "columnsTo": ["id"],
1165
- "onDelete": "cascade",
1166
- "onUpdate": "no action"
1167
1140
  }
1168
1141
  },
1169
1142
  "compositePrimaryKeys": {},
@@ -1193,16 +1166,22 @@
1193
1166
  "name": "description",
1194
1167
  "type": "text",
1195
1168
  "primaryKey": false,
1196
- "notNull": true
1169
+ "notNull": false
1197
1170
  },
1198
- "room_id": {
1199
- "name": "room_id",
1171
+ "roomId": {
1172
+ "name": "roomId",
1173
+ "type": "uuid",
1174
+ "primaryKey": false,
1175
+ "notNull": false
1176
+ },
1177
+ "worldId": {
1178
+ "name": "worldId",
1200
1179
  "type": "uuid",
1201
1180
  "primaryKey": false,
1202
1181
  "notNull": false
1203
1182
  },
1204
- "world_id": {
1205
- "name": "world_id",
1183
+ "entityId": {
1184
+ "name": "entityId",
1206
1185
  "type": "uuid",
1207
1186
  "primaryKey": false,
1208
1187
  "notNull": false
@@ -1217,24 +1196,26 @@
1217
1196
  "name": "tags",
1218
1197
  "type": "text[]",
1219
1198
  "primaryKey": false,
1220
- "notNull": false
1199
+ "notNull": false,
1200
+ "default": "'{}'::text[]"
1221
1201
  },
1222
1202
  "metadata": {
1223
1203
  "name": "metadata",
1224
1204
  "type": "jsonb",
1225
1205
  "primaryKey": false,
1226
- "notNull": false
1206
+ "notNull": false,
1207
+ "default": "'{}'::jsonb"
1227
1208
  },
1228
1209
  "created_at": {
1229
1210
  "name": "created_at",
1230
- "type": "timestamp",
1211
+ "type": "timestamp with time zone",
1231
1212
  "primaryKey": false,
1232
1213
  "notNull": false,
1233
1214
  "default": "now()"
1234
1215
  },
1235
1216
  "updated_at": {
1236
1217
  "name": "updated_at",
1237
- "type": "timestamp",
1218
+ "type": "timestamp with time zone",
1238
1219
  "primaryKey": false,
1239
1220
  "notNull": false,
1240
1221
  "default": "now()"
@@ -5,8 +5,8 @@
5
5
  {
6
6
  "idx": 0,
7
7
  "version": "7",
8
- "when": 1745909982134,
9
- "tag": "0000_low_anita_blake",
8
+ "when": 1746884807264,
9
+ "tag": "0000_snapshot",
10
10
  "breakpoints": true
11
11
  }
12
12
  ]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elizaos/plugin-sql",
3
- "version": "1.0.0-beta.49",
3
+ "version": "1.0.0-beta.50",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
@@ -27,7 +27,7 @@
27
27
  ],
28
28
  "dependencies": {
29
29
  "@electric-sql/pglite": "^0.2.17",
30
- "@elizaos/core": "^1.0.0-beta.49",
30
+ "@elizaos/core": "^1.0.0-beta.50",
31
31
  "@types/pg": "8.11.10",
32
32
  "drizzle-kit": "^0.30.4",
33
33
  "drizzle-orm": "^0.39.1",
@@ -58,5 +58,5 @@
58
58
  "typescript": "5.8.2",
59
59
  "whatwg-url": "7.1.0"
60
60
  },
61
- "gitHead": "739eb780a017ed33f2e399b5afef2f8d6f02fd7e"
61
+ "gitHead": "764c6bbaab227414854ddae91c8f4e512faa8fad"
62
62
  }