Drizzle with self hosted supabase not working

Hello, I created a self hosted instance of supabase on my machine. I am also using nextjs. Because of that I need to be using neon driver to connect to supabase instance.

This is how I create connection
import { Pool } from '@neondatabase/serverless';
import { drizzle } from 'drizzle-orm/neon-serverless';

const connectionString = env.DATABASE_URL;
const pool = new Pool({ connectionString });
export const db = drizzle(pool, { schema: schema, logger: false });


I have my instance hosted on machine 192.168.50.88

Now when I try to push newly generated migration I am getting

[⣷] Pulling schema from database...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,
    _extensions: {},
    _paused: false,
    _protocol: '',
    _readyState: 3,
    _receiver: null,
    _sender: null,
    _socket: null,
    _bufferedAmount: 0,
    _isServer: false,
    _redirects: 0,
    _autoPong: true,
    _url: 'wss://192.168.50.88/v2',
    _req: null,
    [Symbol(shapeMode)]: false,
    [Symbol(kCapture)]: false
  },
  [Symbol(kType)]: 'error',
  [Symbol(kError)]: Error: self-signed certificate
      at TLSSocket.onConnectSecure (node:_tls_wrap:1674:34)
      at TLSSocket.emit (node:events:518:28)
      at TLSSocket._finishInit (node:_tls_wrap:1085:8)
      at ssl.onhandshakedone (node:_tls_wrap:871:12)
      at TLSWrap.callbackTrampoline (node:internal/async_hooks:130:17) {
    code: 'DEPTH_ZERO_SELF_SIGNED_CERT'
  },
  [Symbol(kMessage)]: 'self-signed certificate'
}


my connection string is DATABASE_URL=postgres://postgres.<my password>@192.168.50.88:5432/postgres
Was this page helpful?