@elizaos/plugin-sql 1.6.2-alpha.8 → 1.6.2-beta.0
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/browser/index.browser.js +17 -26
- package/dist/browser/index.browser.js.map +4 -4
- package/dist/browser/tsconfig.build.tsbuildinfo +1 -1
- package/dist/node/index.node.js +7 -16
- package/dist/node/index.node.js.map +6 -6
- package/dist/node/tsconfig.build.node.tsbuildinfo +1 -1
- package/package.json +3 -3
package/dist/node/index.node.js
CHANGED
|
@@ -634,7 +634,7 @@ var init_subquery = __esm(() => {
|
|
|
634
634
|
});
|
|
635
635
|
|
|
636
636
|
// ../../node_modules/drizzle-orm/version.js
|
|
637
|
-
var version = "0.44.
|
|
637
|
+
var version = "0.44.6";
|
|
638
638
|
var init_version = () => {};
|
|
639
639
|
|
|
640
640
|
// ../../node_modules/drizzle-orm/tracing.js
|
|
@@ -8187,10 +8187,6 @@ var agentTable = pgTable("agents", {
|
|
|
8187
8187
|
plugins: jsonb("plugins").$type().default(sql`'[]'::jsonb`).notNull(),
|
|
8188
8188
|
settings: jsonb("settings").$type().default(sql`'{}'::jsonb`).notNull(),
|
|
8189
8189
|
style: jsonb("style").$type().default(sql`'{}'::jsonb`).notNull()
|
|
8190
|
-
}, (table3) => {
|
|
8191
|
-
return {
|
|
8192
|
-
nameUnique: unique("name_unique").on(table3.name)
|
|
8193
|
-
};
|
|
8194
8190
|
});
|
|
8195
8191
|
|
|
8196
8192
|
// src/schema/entity.ts
|
|
@@ -8629,17 +8625,12 @@ class BaseDrizzleAdapter extends DatabaseAdapter {
|
|
|
8629
8625
|
async createAgent(agent) {
|
|
8630
8626
|
return this.withDatabase(async () => {
|
|
8631
8627
|
try {
|
|
8632
|
-
const conditions2 = [];
|
|
8633
8628
|
if (agent.id) {
|
|
8634
|
-
|
|
8635
|
-
|
|
8636
|
-
|
|
8637
|
-
|
|
8638
|
-
|
|
8639
|
-
const existing = conditions2.length > 0 ? await this.db.select({ id: agentTable.id }).from(agentTable).where(or(...conditions2)).limit(1) : [];
|
|
8640
|
-
if (existing.length > 0) {
|
|
8641
|
-
logger8.warn(`Attempted to create an agent with a duplicate ID or name. ID: ${agent.id}, name: ${agent.name}`);
|
|
8642
|
-
return false;
|
|
8629
|
+
const existing = await this.db.select({ id: agentTable.id }).from(agentTable).where(eq(agentTable.id, agent.id)).limit(1);
|
|
8630
|
+
if (existing.length > 0) {
|
|
8631
|
+
logger8.warn(`Attempted to create an agent with a duplicate ID. ID: ${agent.id}`);
|
|
8632
|
+
return false;
|
|
8633
|
+
}
|
|
8643
8634
|
}
|
|
8644
8635
|
await this.db.transaction(async (tx) => {
|
|
8645
8636
|
await tx.insert(agentTable).values({
|
|
@@ -11094,5 +11085,5 @@ export {
|
|
|
11094
11085
|
DatabaseMigrationService
|
|
11095
11086
|
};
|
|
11096
11087
|
|
|
11097
|
-
//# debugId=
|
|
11088
|
+
//# debugId=8BA1B17BEE8B070C64756E2164756E21
|
|
11098
11089
|
//# sourceMappingURL=index.node.js.map
|