Skip to content

Commit 0d447c0

Browse files
committed
Updated readme and examples [skip ci]
1 parent 26df138 commit 0d447c0

5 files changed

Lines changed: 11 additions & 11 deletions

File tree

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,19 +44,19 @@ Enable the extension
4444
await client.query('CREATE EXTENSION IF NOT EXISTS vector');
4545
```
4646

47-
Register the type for a client
47+
Register the types for a client
4848

4949
```javascript
5050
import pgvector from 'pgvector/pg';
5151

52-
await pgvector.registerType(client);
52+
await pgvector.registerTypes(client);
5353
```
5454

5555
or a pool
5656

5757
```javascript
5858
pool.on('connect', async function (client) {
59-
await pgvector.registerType(client);
59+
await pgvector.registerTypes(client);
6060
});
6161
```
6262

@@ -267,13 +267,13 @@ Enable the extension
267267
await sequelize.query('CREATE EXTENSION IF NOT EXISTS vector');
268268
```
269269

270-
Register the type
270+
Register the types
271271

272272
```javascript
273273
import { Sequelize } from 'sequelize';
274274
import pgvector from 'pgvector/sequelize';
275275

276-
pgvector.registerType(Sequelize);
276+
pgvector.registerTypes(Sequelize);
277277
```
278278

279279
Add a vector field
@@ -329,15 +329,15 @@ Enable the extension
329329
await db.none('CREATE EXTENSION IF NOT EXISTS vector');
330330
```
331331

332-
Register the type
332+
Register the types
333333

334334
```javascript
335335
import pgpromise from 'pg-promise';
336336
import pgvector from 'pgvector/pg-promise';
337337

338338
const initOptions = {
339339
async connect(e) {
340-
await pgvector.registerType(e.client);
340+
await pgvector.registerTypes(e.client);
341341
}
342342
};
343343
const pgp = pgpromise(initOptions);

examples/disco/example.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const client = new pg.Client({database: 'pgvector_example'});
66
await client.connect();
77

88
await client.query('CREATE EXTENSION IF NOT EXISTS vector');
9-
await pgvector.registerType(client);
9+
await pgvector.registerTypes(client);
1010

1111
await client.query('DROP TABLE IF EXISTS users');
1212
await client.query('DROP TABLE IF EXISTS movies');

examples/loading/example.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ await client.connect();
1414

1515
// enable extension
1616
await client.query('CREATE EXTENSION IF NOT EXISTS vector');
17-
await pgvector.registerType(client);
17+
await pgvector.registerTypes(client);
1818

1919
// create table
2020
await client.query('DROP TABLE IF EXISTS items');

examples/openai/example.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const client = new pg.Client({database: 'pgvector_example'});
66
await client.connect();
77

88
await client.query('CREATE EXTENSION IF NOT EXISTS vector');
9-
await pgvector.registerType(client);
9+
await pgvector.registerTypes(client);
1010

1111
await client.query('DROP TABLE IF EXISTS documents');
1212
await client.query('CREATE TABLE documents (id bigserial PRIMARY KEY, content text, embedding vector(1536))');

examples/transformers/example.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const client = new pg.Client({database: 'pgvector_example'});
66
await client.connect();
77

88
await client.query('CREATE EXTENSION IF NOT EXISTS vector');
9-
await pgvector.registerType(client);
9+
await pgvector.registerTypes(client);
1010

1111
await client.query('DROP TABLE IF EXISTS documents');
1212
await client.query('CREATE TABLE documents (id bigserial PRIMARY KEY, content text, embedding vector(384))');

0 commit comments

Comments
 (0)