mirror of
https://github.com/R0m1k3/Socialflow.git
synced 2026-10-11 17:26:45 +02:00
Update database connection to use the standard pg driver
Replaced `@neondatabase/serverless` with `pg` for database connections in `server/db.ts`, updating the `drizzle` initialization accordingly. Replit-Commit-Author: Agent Replit-Commit-Session-Id: ae4037a0-2a6f-4530-9bac-79b543286bda Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/397bca8c-984f-43ff-841a-10897aeb8140/ae4037a0-2a6f-4530-9bac-79b543286bda/Yxw6kHP
This commit is contained in:
1 parent
c0ae8f5876
commit
d63f776af0
3 files changed
+203
-10
No files matched your search
@@ -14,10 +14,6 @@ run = ["npm", "run", "start"]
|
|||||||
localPort = 5000
|
localPort = 5000
|
||||||
externalPort = 80
|
externalPort = 80
|
||||||
|
|
||||||
[[ports]]
|
|
||||||
localPort = 38463
|
|
||||||
externalPort = 3000
|
|
||||||
|
|
||||||
[env]
|
[env]
|
||||||
PORT = "5000"
|
PORT = "5000"
|
||||||
|
|
||||||
|
|||||||
+200
@@ -0,0 +1,200 @@
|
|||||||
|
Reading config file '/app/drizzle.config.ts'
|
||||||
|
|
||||||
|
Using 'pg' driver for database querying
|
||||||
|
|
||||||
|
[⣷] Pulling schema from database...
|
||||||
|
|
||||||
|
[✓] Pulling schema from database...
|
||||||
|
|
||||||
|
[✓] Changes applied
|
||||||
|
|
||||||
|
> rest-express@1.0.0 start
|
||||||
|
|
||||||
|
> NODE_ENV=production node dist/index.js
|
||||||
|
|
||||||
|
OPENROUTER_API_KEY not set. AI text generation will not work.
|
||||||
|
|
||||||
|
2:57:45 PM [express] serving on port 5555
|
||||||
|
|
||||||
|
Scheduler service started
|
||||||
|
|
||||||
|
Error processing pending posts: ErrorEvent {
|
||||||
|
|
||||||
|
[Symbol(kTarget)]: WebSocket {
|
||||||
|
|
||||||
|
_events: [Object: null prototype] {
|
||||||
|
|
||||||
|
error: [Function],
|
||||||
|
|
||||||
|
message: [Function],
|
||||||
|
|
||||||
|
close: [Function],
|
||||||
|
|
||||||
|
open: [Function]
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
_eventsCount: 4,
|
||||||
|
|
||||||
|
_maxListeners: undefined,
|
||||||
|
|
||||||
|
_binaryType: 'arraybuffer',
|
||||||
|
|
||||||
|
_closeCode: 1006,
|
||||||
|
|
||||||
|
_closeFrameReceived: false,
|
||||||
|
|
||||||
|
_closeFrameSent: false,
|
||||||
|
|
||||||
|
_closeMessage: <Buffer >,
|
||||||
|
|
||||||
|
_closeTimer: null,
|
||||||
|
|
||||||
|
_errorEmitted: true,
|
||||||
|
|
||||||
|
_extensions: {},
|
||||||
|
|
||||||
|
_paused: false,
|
||||||
|
|
||||||
|
_protocol: '',
|
||||||
|
|
||||||
|
_readyState: 3,
|
||||||
|
|
||||||
|
_receiver: null,
|
||||||
|
|
||||||
|
_sender: null,
|
||||||
|
|
||||||
|
_socket: null,
|
||||||
|
|
||||||
|
_bufferedAmount: 0,
|
||||||
|
|
||||||
|
_isServer: false,
|
||||||
|
|
||||||
|
_redirects: 0,
|
||||||
|
|
||||||
|
_autoPong: true,
|
||||||
|
|
||||||
|
_url: 'wss://postgres/v2',
|
||||||
|
|
||||||
|
_req: null,
|
||||||
|
|
||||||
|
[Symbol(shapeMode)]: false,
|
||||||
|
|
||||||
|
[Symbol(kCapture)]: false
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
[Symbol(kType)]: 'error',
|
||||||
|
|
||||||
|
[Symbol(kError)]: Error: connect ECONNREFUSED 172.23.0.2:443
|
||||||
|
|
||||||
|
at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1611:16) {
|
||||||
|
|
||||||
|
errno: -111,
|
||||||
|
|
||||||
|
code: 'ECONNREFUSED',
|
||||||
|
|
||||||
|
syscall: 'connect',
|
||||||
|
|
||||||
|
address: '172.23.0.2',
|
||||||
|
|
||||||
|
port: 443
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
[Symbol(kMessage)]: 'connect ECONNREFUSED 172.23.0.2:443'
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
Error processing pending posts: ErrorEvent {
|
||||||
|
|
||||||
|
[Symbol(kTarget)]: WebSocket {
|
||||||
|
|
||||||
|
_events: [Object: null prototype] {
|
||||||
|
|
||||||
|
error: [Function],
|
||||||
|
|
||||||
|
message: [Function],
|
||||||
|
|
||||||
|
close: [Function],
|
||||||
|
|
||||||
|
open: [Function]
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
_eventsCount: 4,
|
||||||
|
|
||||||
|
_maxListeners: undefined,
|
||||||
|
|
||||||
|
_binaryType: 'arraybuffer',
|
||||||
|
|
||||||
|
_closeCode: 1006,
|
||||||
|
|
||||||
|
_closeFrameReceived: false,
|
||||||
|
|
||||||
|
_closeFrameSent: false,
|
||||||
|
|
||||||
|
_closeMessage: <Buffer >,
|
||||||
|
|
||||||
|
_closeTimer: null,
|
||||||
|
|
||||||
|
_errorEmitted: true,
|
||||||
|
|
||||||
|
_extensions: {},
|
||||||
|
|
||||||
|
_paused: false,
|
||||||
|
|
||||||
|
_protocol: '',
|
||||||
|
|
||||||
|
_readyState: 3,
|
||||||
|
|
||||||
|
_receiver: null,
|
||||||
|
|
||||||
|
_sender: null,
|
||||||
|
|
||||||
|
_socket: null,
|
||||||
|
|
||||||
|
_bufferedAmount: 0,
|
||||||
|
|
||||||
|
_isServer: false,
|
||||||
|
|
||||||
|
_redirects: 0,
|
||||||
|
|
||||||
|
_autoPong: true,
|
||||||
|
|
||||||
|
_url: 'wss://postgres/v2',
|
||||||
|
|
||||||
|
_req: null,
|
||||||
|
|
||||||
|
[Symbol(shapeMode)]: false,
|
||||||
|
|
||||||
|
[Symbol(kCapture)]: false
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
[Symbol(kType)]: 'error',
|
||||||
|
|
||||||
|
[Symbol(kError)]: Error: connect ECONNREFUSED 172.23.0.2:443
|
||||||
|
|
||||||
|
at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1611:16) {
|
||||||
|
|
||||||
|
errno: -111,
|
||||||
|
|
||||||
|
code: 'ECONNREFUSED',
|
||||||
|
|
||||||
|
syscall: 'connect',
|
||||||
|
|
||||||
|
address: '172.23.0.2',
|
||||||
|
|
||||||
|
port: 443
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
[Symbol(kMessage)]: 'connect ECONNREFUSED 172.23.0.2:443'
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
+3
-6
@@ -1,10 +1,7 @@
|
|||||||
import { Pool, neonConfig } from '@neondatabase/serverless';
|
import { Pool } from 'pg';
|
||||||
import { drizzle } from 'drizzle-orm/neon-serverless';
|
import { drizzle } from 'drizzle-orm/node-postgres';
|
||||||
import ws from "ws";
|
|
||||||
import * as schema from "@shared/schema";
|
import * as schema from "@shared/schema";
|
||||||
|
|
||||||
neonConfig.webSocketConstructor = ws;
|
|
||||||
|
|
||||||
if (!process.env.DATABASE_URL) {
|
if (!process.env.DATABASE_URL) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
"DATABASE_URL must be set. Did you forget to provision a database?",
|
"DATABASE_URL must be set. Did you forget to provision a database?",
|
||||||
@@ -12,4 +9,4 @@ if (!process.env.DATABASE_URL) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const pool = new Pool({ connectionString: process.env.DATABASE_URL });
|
export const pool = new Pool({ connectionString: process.env.DATABASE_URL });
|
||||||
export const db = drizzle({ client: pool, schema });
|
export const db = drizzle(pool, { schema });
|
||||||
Reference in new issue
Block a user