switch agent from sqlite to postgres
Describe the bug
i have an agent running in V2 dev mode. Now i want to set the postgres db for the agent. i added the adapter-postgres and added it to .env like this
POSTGRES_URL=postgresql://neondb_owner:*****@royal-sound-a2hlzmuj-pooler.eu-central-1.aws.neon.tech/supahdev?sslmode=require
just like the eliza.how and the llm file states.
But my agent keeps loading the Sqlite db instead of the postgres db.
Expected behavior
the postgress to be used for the agent
Additional context
hope someone can point me to the proper way to change the agent from sqlite to postgress
Hello @Icarus-Community! Welcome to the elizaOS community. Thank you for opening your first issue; we appreciate your contribution. You are now an elizaOS contributor!
Or should i just delete the db.sqlite file so the systems does not default load that one?
If it is locating the .env and the plugin has been added to the character or plugins array of your project then it should definitely work. Do you have a project or reproducible demo of this?
i had it added to the character and .env is this the properway? i got it from eliza.how - usually the settings dont need "" in .env so it trows me off a bit.
POSTGRES_URL="postgresql://neondb_owner:np*****G2Vy5@ep-royal-sound-a2hl******er.eu-central-1.aws.neon.tech/supahdev?sslmode=require"
i now installed the plugin and get the following error.
Failed to import plugin: @elizaos-plugins/adapter-postgres file:///root/elizaos/eliza/packages/adapter-postgres/dist/index.js:4 import { DatabaseAdapter, EmbeddingProvider, elizaLogger, getEmbeddingConfig } from "@elizaos/core-plugin-v1"; ^^^^^^^^^^^^^^^ SyntaxError: The requested module '@elizaos/core-plugin-v1' does not provide an export named 'DatabaseAdapter' at ModuleJob._instantiate (node:internal/modules/esm/module_job:182:21) at async ModuleJob.run (node:internal/modules/esm/module_job:266:5) at async onImport.tracePromise.proto (node:internal/modules/esm/loader:644:26) at async file:///root/elizaos/eliza/agent/src/index.ts:302:40 at async Promise.all (index 8) at async handlePluginImporting (file:///root/elizaos/eliza/agent/src/index.ts:300:33) at async jsonToCharacter (file:///root/elizaos/eliza/agent/src/index.ts:180:25) at async loadCharacterTryPath (file:///root/elizaos/eliza/agent/src/index.ts:239:27) at async loadCharacters (file:///root/elizaos/eliza/agent/src/index.ts:274:35) at async startAgents (file:///root/elizaos/eliza/agent/src/index.ts:639:22)
tried installing Supabase to test that adapter and it threw the same error.
@Icarus-Community no need for adapter-postgres on 1.x version. You just have to setup your url:
POSTGRES_URL="postgresql://neondb_owner:np*****G2Vy5@ep-royal-sound-a2hl******er.eu-central-w1.aws.neon.tech/supahdev?sslmode=require"
If you wanna look where database is https://github.com/elizaOS/eliza/blob/v2-develop/packages/plugin-sql/src/index.ts#L86
Basically for POSTGRES_URL you can provider any postgres instance, cloud based like supabase, neon,tech and similar.