Skip to content

Commit 732037f

Browse files
committed
Deprecated registerType function for node-postgres
1 parent 809a289 commit 732037f

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

‎CHANGELOG.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
## 0.3.0 (unreleased)
22

33
- Switched to ESM
4+
- Deprecated `registerType` function for node-postgres (use `registerTypes` instead)
45
- Deprecated `registerTypes` function for Sequelize (use `import 'pgvector/sequelize'` instead)
56
- Deprecated `enableExtension` function for Knex.js and Objection.js (use `createExtensionIfNotExists` instead)
67
- Dropped support for Node < 22

‎src/pg/index.js‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { deprecate } from 'node:util';
12
import { toSql, vectorFromSql, halfvecFromSql, sparsevecFromSql } from '../utils/index.js';
23

34
async function registerTypes(client) {
@@ -29,7 +30,7 @@ async function registerTypes(client) {
2930
}
3031
}
3132

32-
const registerType = registerTypes;
33+
const registerType = deprecate(registerTypes, 'registerType() is deprecated. Use registerTypes() instead.');
3334

3435
export { registerType, registerTypes, toSql };
3536

0 commit comments

Comments
 (0)