Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add vector as column type to postgres #10138

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/entities.md
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,8 @@ or
`tsvector`, `tsquery`, `uuid`, `xml`, `json`, `jsonb`, `int4range`, `int8range`, `numrange`,
`tsrange`, `tstzrange`, `daterange`, `geometry`, `geography`, `cube`, `ltree`

> Note: `vector` is also available when the [pgvector](https://github.com/pgvector/pgvector) extension is installed.

### Column types for `cockroachdb`

`array`, `bool`, `boolean`, `bytes`, `bytea`, `blob`, `date`, `numeric`, `decimal`, `dec`, `float`,
Expand Down
2 changes: 1 addition & 1 deletion docs/zh_CN/entities.md
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ TypeORM 支持所有最常用的数据库支持的列类型。
`date`, `time`, `time without time zone`, `time with time zone`, `interval`, `bool`, `boolean`,
`enum`, `point`, `line`, `lseg`, `box`, `path`, `polygon`, `circle`, `cidr`, `inet`, `macaddr`,
`tsvector`, `tsquery`, `uuid`, `xml`, `json`, `jsonb`, `int4range`, `int8range`, `numrange`,
`tsrange`, `tstzrange`, `daterange`, `geometry`, `geography`
`tsrange`, `tstzrange`, `daterange`, `geometry`, `geography`, `vector`

### `sqlite`/`cordova`/`react-native`/`expo`的列类型

Expand Down
2 changes: 2 additions & 0 deletions src/driver/postgres/PostgresDriver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ export class PostgresDriver implements Driver {
"geography",
"cube",
"ltree",
"vector",
]

/**
Expand All @@ -207,6 +208,7 @@ export class PostgresDriver implements Driver {
"bit",
"varbit",
"bit varying",
"vector",
]

/**
Expand Down
1 change: 1 addition & 0 deletions src/driver/types/ColumnTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ export type WithLengthColumnType =
| "binary" // mssql
| "varbinary" // mssql, sap
| "string" // cockroachdb, spanner
| "vector" // postgres pgvector

export type WithWidthColumnType =
| "tinyint" // mysql
Expand Down