File size: 587 Bytes
6248bf4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24

const { Client } = require('pg');
const dotenv = require('dotenv');
dotenv.config();

async function main() {
    const client = new Client({
        connectionString: process.env.DATABASE_URL,
    });
    try {
        await client.connect();
        console.log('Enabling pgvector...');
        await client.query('CREATE EXTENSION IF NOT EXISTS vector;');
        console.log('✅ pgvector enabled successfully.');
    } catch (err) {
        console.error('❌ Failed to enable pgvector:', err);
        process.exit(1);
    } finally {
        await client.end();
    }
}

main();