PostgreSQL coverage
What postgrelize does with PostgreSQL 16–18 features, row by row. The list is checked against the repository: every Supported row names a test that exercises it, and every feature that Sequelize v6 lacks also links a guide section and a runnable example. CI fails when a test, an example or a guide section goes missing.
| Status | Meaning |
|---|---|
| Supported | A dedicated API exists and a test in this repository runs it against PostgreSQL. |
| Via literal / raw | Works through literal(), fn(), a raw sequelize.query() or a driver option; no helper. |
| Planned | A real gap an ORM should cover. Not implemented yet; the note shows the workaround. |
| Out of scope | Server administration or internals. The note gives the reason. |
SELECT clauses
| Feature | PG | Status | Notes | Docs |
|---|---|---|---|---|
| DISTINCT ON | 16+ | Supported | `distinctOn` find option. | Guide · Example |
| Window functions (OVER, PARTITION BY) | 16+ | Supported | `over()` expression; named `WINDOW` clauses and frame clauses are not modelled. | Guide · Example |
| CTEs and WITH RECURSIVE | 16+ | Supported | `with` find option. | Guide · Example |
| CTE MATERIALIZED / NOT MATERIALIZED | 16+ | Supported | `materialized` flag of a CTE definition. | Guide · Example |
| Data-modifying CTEs (WITH … UPDATE/DELETE … RETURNING) | 16+ | Supported | `Model.updateStatement()`, `deleteStatement()`, `insertStatement()` in `with`; the query goes to the writer. `INSERT … SELECT FROM cte` as the main statement is not supported. | Guide · Example |
| CTE SEARCH / CYCLE clauses | 16+ | Supported | `search` and `cycle` in a recursive `with` definition; `cycle.using` is required. | Guide · Example |
| LATERAL joins | 16+ | Supported | `from: { alias: { lateral: subquery } }`; `lateral: true` on a `separate` include with `limit` reads the top rows per parent. | Guide · Example |
| GROUPING SETS / ROLLUP / CUBE | 16+ | Via literal / raw | `group: literal("ROLLUP (a, b)")`. `GROUPING()` through `fn("grouping", …)`. | |
| Row locks: FOR UPDATE / NO KEY UPDATE / SHARE / KEY SHARE, OF, NOWAIT, SKIP LOCKED | 16+ | Supported | `lock`, `skipLocked`, `noWait` find options. | same as v6 |
| ORDER BY … NULLS FIRST / LAST | 16+ | Supported | Order direction string, e.g. `["rank", "ASC NULLS LAST"]`. | Guide · Example |
| TABLESAMPLE | 16+ | Supported | `sample: { method, percent, seed }` find option and `{ model, sample }` in `from`. | Guide · Example |
| FETCH FIRST … WITH TIES | 16+ | Supported | `withTies: true` with `limit` and `order`. | Guide · Example |
| UNION / INTERSECT / EXCEPT [ALL] | 16+ | Supported | `Subquery#union()`, `intersect()`, `except()` (`{ all: true }`); `source: subquery` reads model rows from the result. | Guide · Example |
| Subqueries (IN, scalar, EXISTS / NOT EXISTS, correlated) | 16+ | Supported | `Model.subquery()`, `exists()`, `notExists()`; `IN (subquery)` in `where`. | Guide · Example |
| Row-value comparison (keyset pagination) | 16+ | Supported | `tuple()` expression. | Guide · Example |
| Standalone VALUES lists and set-returning functions in FROM (unnest, generate_series, WITH ORDINALITY) | 16+ | Supported | `from` entries `{ values }` and `{ function, args, columns, ordinality }`. | Guide · Example |
| Aggregates with FILTER, ORDER BY and ordered-set forms | 16+ | Via literal / raw | Plain aggregates through `fn()`; `FILTER (WHERE …)` and `WITHIN GROUP` through `literal()`. | |
| ONLY (table inheritance) | 16+ | Out of scope | Legacy inheritance; partitioning is the supported way to split tables. |
DML
| Feature | PG | Status | Notes | Docs |
|---|---|---|---|---|
| INSERT … ON CONFLICT DO NOTHING | 16+ | Supported | `onConflict` with `action: "nothing"`. | Guide · Example |
| ON CONFLICT DO UPDATE with expressions and inserted/updated flag | 16+ | Supported | `onConflict` update action with `excluded()`; `Model.insert()` reports `wasInserted`. | Guide · Example |
| ON CONFLICT DO UPDATE … WHERE | 16+ | Supported | `where` of the `onConflict` update action. | Guide · Example |
| ON CONFLICT ON CONSTRAINT, expression and partial-index targets | 16+ | Supported | `onConflict` targets: `constraint`, columns or expressions, with `where`. | Guide · Example |
| INSERT … OVERRIDING SYSTEM / USER VALUE | 16+ | Supported | `overriding: "system" | "user"` write option. | Guide · Example |
| INSERT … SELECT | 16+ | Supported | `Model.insertFrom()`. | Guide · Example |
| UPDATE … FROM and DELETE … USING | 16+ | Supported | `from` option of `Model.update`, `using` option of `Model.destroy`. | Guide · Example |
| UPDATE SET (a, b) = (sub-SELECT) and WHERE CURRENT OF | 16+ | Via literal / raw | Per-column expressions work through `literal()`; row-assignment forms need a raw query. | |
| MERGE (WHEN MATCHED / NOT MATCHED, DELETE, DO NOTHING) | 16+ | Supported | `Model.merge()` with VALUES or subquery source. | Guide · Example |
| MERGE … RETURNING merge_action() and WHEN NOT MATCHED BY SOURCE | 17+ | Supported | Rejected before running on servers older than 17. | Guide · Example |
| RETURNING on INSERT / UPDATE / DELETE | 16+ | Supported | `returning` option of create, bulkCreate, update, destroy. | same as v6 |
| RETURNING OLD (pre-statement values) | 18+ | Supported | `returningOld` → `instance.oldValues`. `RETURNING NEW` is the default row. | Guide · Example |
| TRUNCATE | 16+ | Supported | `Model.truncate()`. | same as v6 |
| COPY FROM STDIN (bulk load) | 16+ | Supported | `Model.copyFrom()` streams arrays and async iterables. | Guide · Example |
| COPY TO STDOUT (export) | 16+ | Supported | `Model.copyTo()` returns an async iterable. | Guide · Example |
| Bulk insert via UNNEST arrays | 16+ | Supported | `bulkCreate(rows, { unnest: true })`. | Guide · Example |
Operators and functions
| Feature | PG | Status | Notes | Docs |
|---|---|---|---|---|
| Comparison and logical operators (=, <>, <, >, BETWEEN, IN, IS NULL, AND/OR/NOT) | 16+ | Supported | `Op.*` as in Sequelize v6. | same as v6 |
| IS [NOT] DISTINCT FROM | 16+ | Supported | `Op.isDistinctFrom`, `Op.isNotDistinctFrom`. | Guide · Example |
| = ANY($1) for long IN lists | 16+ | Supported | Automatic above `inAsAnyThreshold`. | Guide · Example |
| LIKE / ILIKE patterns | 16+ | Supported | `Op.like`, `Op.iLike`, `Op.startsWith`, `Op.endsWith`, `Op.substring`. | same as v6 |
| POSIX regular expressions (~, ~*, !~, !~*) | 16+ | Supported | `Op.regexp`, `Op.iRegexp` and negations. | same as v6 |
| SIMILAR TO | 16+ | Supported | `Op.similarTo`, `Op.notSimilarTo`. | Guide · Example |
| JSON / JSONB containment, nested paths and key-exists (@>, #>>, ?, ?|, ?&) | 16+ | Supported | Nested `where` objects, `Op.contains`, `Op.hasKey`, `Op.hasAnyKeys`, `Op.hasAllKeys`. | same as v6 |
| jsonpath operators (@?, @@) and jsonb_path_* functions | 16+ | Supported | `Op.jsonPathExists` (`@?`), `Op.match` through `where()` (`@@`), `jsonbPath()` for the `jsonb_path_*` functions. | Guide · Example |
| SQL/JSON constructors and query functions (JSON_EXISTS, JSON_QUERY, JSON_VALUE) | 17+ | Via literal / raw | Through `literal()` in attributes or `where`. | |
| JSON_TABLE | 17+ | Supported | `from` entry `{ jsonTable: { doc, path, columns } }`; `NESTED PATH` is not modelled. | Guide · Example |
| Array operators (@>, <@, &&, ANY, ALL) | 16+ | Supported | `Op.contains`, `Op.contained`, `Op.overlap`, `Op.any`, `Op.all`. | same as v6 |
| Range operators (@>, &&, <<, >>, &<, &>, -|-) | 16+ | Supported | `Op.contains`, `Op.overlap`, `Op.strictLeft`, `Op.strictRight`, `Op.noExtendLeft`, `Op.noExtendRight`, `Op.adjacent`. | same as v6 |
| Multirange operators and functions (range_agg, unnest) | 16+ | Supported | Range operators (`Op.contains`, `Op.overlap`, `Op.strictLeft`, …) on multirange columns; `range_agg`, `unnest` through `fn()`. | Guide · Example |
| Full-text search match (@@) | 16+ | Supported | `Op.match` with `fn("to_tsquery", …)` / `fn("websearch_to_tsquery", …)`. | Guide · Example |
| Full-text ranking and highlighting (ts_rank, ts_headline, setweight) | 16+ | Supported | `tsRank` (also `ts_rank_cd`), `tsHeadline`, `setWeight`, `toTsVector`, `toTsQuery`, `plainToTsQuery`, `phraseToTsQuery`, `websearchToTsQuery` with an optional configuration. | Guide · Example |
| Network operators (<<, <<=, >>, >>=, host(), network()) | 16+ | Supported | `Op.strictLeft`, `Op.strictRight`, `Op.containedOrEqual`, `Op.containsOrEqual`, `Op.overlap`; `host()` and `network()` through `fn()`. | Guide · Example |
| Geometric operators and functions | 16+ | Supported | `Op.contains`, `Op.contained`, `Op.overlap`, `Op.strictLeft`, `Op.strictRight` on geometric columns; operands of another type need `cast()`; `<->`, `?#` and functions through `literal()` / `fn()`. | Guide · Example |
| hstore operators (->, ?, @>) | 16+ | Supported | `Op.contains` and `Op.eq` take objects; `->`, `?` and other operators through `literal()`. | Guide · Example |
| ltree operators (@>, <@, ~, ?) | 16+ | Via literal / raw | Equality and `IN` work on `DataTypes.LTREE` columns; `<@`, `@>`, `~` and `?` through `literal()` (see the ltree row in Data types). | |
| pg_trgm similarity (%, similarity(), word_similarity()) | 16+ | Supported | `Op.trigramSimilar` and word variants, `trigramSimilarity()`, `trigramWordSimilarity()`, `trigramDistance()` (`<->`); needs `CREATE EXTENSION pg_trgm`; the `gin_trgm_ops` index uses the `operator` index option. | Guide · Example |
| UUID functions (gen_random_uuid, uuidv7) | 16+ | Supported | `fn("gen_random_uuid")` as default or expression; `uuidv7()` needs PostgreSQL 18; `DataTypes.UUIDV4` generates client-side. | same as v6 |
| Interval arithmetic and date functions (date_trunc, age, make_interval) | 16+ | Via literal / raw | Through `fn()` / `literal()`; the INTERVAL column type is supported. | |
| Any SQL function or expression through fn(), cast(), col(), literal() | 16+ | Supported | Function names pass an allowlist; `literal()` is raw by design. | same as v6 |
Data types
| Feature | PG | Status | Notes | Docs |
|---|---|---|---|---|
| smallint, integer, bigint, serial, identity | 16+ | Supported | `SMALLINT`, `INTEGER`, `BIGINT` (returned as string), `autoIncrement` (serial or identity). | same as v6 |
| numeric / decimal, real, double precision | 16+ | Supported | `DECIMAL(p, s)` returned as string; `REAL`, `DOUBLE`, `FLOAT`. | same as v6 |
| text, varchar, char, boolean | 16+ | Supported | `TEXT`, `STRING(n)`, `CHAR(n)`, `BOOLEAN`. | same as v6 |
| timestamptz, date, time | 16+ | Supported | `DATE` (timestamptz), `DATEONLY`, `TIME`. | same as v6 |
| timestamp without time zone | 16+ | Supported | `DataTypes.TIMESTAMP(fsp?)`; values are `Date`s with the local wall-clock time. | Guide · Example |
| interval | 16+ | Supported | `DataTypes.INTERVAL`. | Guide · Example |
| money | 16+ | Supported | `DataTypes.MONEY`; read as the server formats it (`lc_monetary`, e.g. `$12.50`); write numbers or strings. | Guide · Example |
| bytea | 16+ | Supported | `DataTypes.BLOB` ↔ `Buffer`. | same as v6 |
| enum (CREATE TYPE … AS ENUM) | 16+ | Supported | `DataTypes.ENUM`; `sync({ alter })` adds new values. | same as v6 |
| composite types | 16+ | Supported | `DataTypes.COMPOSITE(name, fields)` with object values; `createSql()` renders `CREATE TYPE`; array fields are not supported. | Guide · Example |
| domains | 16+ | Via literal / raw | Create with raw DDL, then use the base type in the model; the type name cannot be set directly. | |
| arrays (including arrays of enum) | 16+ | Supported | `DataTypes.ARRAY(type)`. | same as v6 |
| range types (int4range, int8range, numrange, daterange, tsrange, tstzrange) | 16+ | Supported | `DataTypes.RANGE(type)` with `[lower, upper]` values. | same as v6 |
| multirange types | 16+ | Supported | `DataTypes.MULTIRANGE(type)` (PostgreSQL 14+) with arrays of `[lower, upper]` ranges. | Guide · Example |
| json and jsonb | 16+ | Supported | `DataTypes.JSON`, `DataTypes.JSONB`. | same as v6 |
| xml | 16+ | Supported | `DataTypes.XML`; values are XML text; `xpath()` through `literal()` / `fn()`. | Guide · Example |
| bit and bit varying | 16+ | Supported | `DataTypes.BIT(n)`, `DataTypes.VARBIT(n)`; values are strings of `0` and `1`. | Guide · Example |
| uuid | 16+ | Supported | `DataTypes.UUID` with `UUIDV4` client default. | same as v6 |
| inet, cidr, macaddr | 16+ | Supported | `DataTypes.INET`, `CIDR`, `MACADDR`. | same as v6 |
| macaddr8 | 16+ | Supported | `DataTypes.MACADDR8`. | Guide · Example |
| geometric types (point, line, lseg, box, path, polygon, circle) | 16+ | Supported | `DataTypes.POINT`, `LINE`, `LSEG`, `BOX`, `PATH`, `POLYGON`, `CIRCLE` with object / point-array values. | Guide · Example |
| tsvector | 16+ | Supported | `DataTypes.TSVECTOR`. | same as v6 |
| tsquery | 16+ | Supported | `DataTypes.TSQUERY`; values are query strings (`'fat' & 'rat'`). | Guide · Example |
| pg_lsn, txid_snapshot and other system types | 16+ | Out of scope | Replication and internals types; read through raw queries. | |
| citext (extension) | 16+ | Supported | `DataTypes.CITEXT`; run `CREATE EXTENSION citext` first. | same as v6 |
| hstore (extension) | 16+ | Supported | `DataTypes.HSTORE`; values are objects of strings (or `null`); run `CREATE EXTENSION hstore` first. | same as v6 |
| ltree (extension) | 16+ | Supported | `DataTypes.LTREE`; values are strings (`'Top.Science'`); run `CREATE EXTENSION ltree` first. | Guide · Example |
| PostGIS geometry / geography | 16+ | Supported | `DataTypes.GEOMETRY(type, srid)` / `GEOGRAPHY(type, srid)` with GeoJSON values (SRID in `crs`); needs `CREATE EXTENSION postgis`; tests run only where PostGIS is installed (CI job `PostGIS`). | same as v6 |
| Stored and virtual generated columns, identity columns | 16+ | Supported | `generated: { as, stored }` and `identity: "always" | "byDefault"` column options. `VIRTUAL` generated columns need PostgreSQL 18. | Guide · Example |
DDL (sync and QueryInterface)
| Feature | PG | Status | Notes | Docs |
|---|---|---|---|---|
| Tables from models (sync, force, alter) and createTable / dropTable | 16+ | Supported | `sequelize.sync()`, `QueryInterface.createTable()`. | same as v6 |
| Primary key, unique, check and foreign-key constraints with referential actions | 16+ | Supported | `addConstraint`, column `references`, `onDelete`, `onUpdate`. | same as v6 |
| DEFERRABLE constraints | 16+ | Supported | `Deferrable` values on `references`. | same as v6 |
| UNIQUE NULLS NOT DISTINCT | 16+ | Supported | `nullsNotDistinct` on unique columns, constraints and indexes. | Guide · Example |
| EXCLUDE constraints | 16+ | Supported | `addConstraint({ type: 'exclude', exclude: [{ name | expression, with }], using, where, include, deferrable })`; violations raise `ExclusionConstraintError`. | Guide · Example |
| NOT VALID constraints and VALIDATE CONSTRAINT | 16+ | Supported | `notValid` on check and foreign key constraints, `validateConstraint`. | Guide · Example |
| NOT ENFORCED constraints, WITHOUT OVERLAPS keys, FK PERIOD | 18+ | Supported | `enforced: false`, `withoutOverlaps`, `period` and `references.fields` on `addConstraint`; PostgreSQL 18 syntax, sent as written. | Guide · Example |
| Indexes: unique, partial, covering (INCLUDE), GIN, BRIN, CONCURRENTLY, IF NOT EXISTS | 16+ | Supported | `addIndex` / model `indexes`: `where`, `include`, `using`, `operator`, `concurrently`, `ifNotExists`. GiST, SP-GiST and hash go through `using`. | same as v6 |
| Expression indexes (lower(email)) | 16+ | Supported | `{ expression }` index fields (trusted SQL) with `collate`, `operator`, `order`, `nulls`, `include`; an explicit `name` is required. | Guide · Example |
| ALTER TABLE: add / change / rename / remove column, rename table | 16+ | Supported | `QueryInterface` methods. | same as v6 |
| Enum ALTER (ADD VALUE) | 16+ | Supported | `sync({ alter: true })`; `dropEnum` and `dropAllEnums`. | same as v6 |
| Comments on tables and columns | 16+ | Supported | `comment` option on `createTable` and columns. | same as v6 |
| Schemas | 16+ | Supported | `createSchema`, `dropSchema`, `showAllSchemas`, model `schema` option. | same as v6 |
| Introspection (describeTable, showAllTables, tableExists, foreign keys) | 16+ | Supported | `QueryInterface`; every query filters by schema. | same as v6 |
| Views and materialized views | 16+ | Supported | `createView` (`replace`, `temporary`, `recursive`, `checkOption`), `createMaterializedView`, `refreshMaterializedView` (`concurrently`), `dropView`, `dropMaterializedView`; the query is trusted SQL. | Guide · Example |
| Sequences (CREATE SEQUENCE, setval) | 16+ | Supported | `createSequence`, `alterSequence`, `dropSequence`, `nextval`, `setval`; serial and identity sequences stay with `autoIncrement`. | Guide · Example |
| Functions and triggers | 16+ | Supported | `createFunction`, `dropFunction`, `renameFunction`, `createTrigger`, `dropTrigger`, `renameTrigger` with the v6 names; bodies and `WHEN` clauses are trusted SQL. | Guide · Example |
| Declarative partitioning (PARTITION BY / PARTITION OF / ATTACH) | 16+ | Supported | `createTable({ partitionBy })`, `createPartition`, `attachPartition`, `detachPartition` (`concurrently`, `finalize`); bounds `in`, `from` / `to`, `modulus` / `remainder`, `default`. `sync` does not create partitions. | Guide · Example |
| Extensions (CREATE EXTENSION) | 16+ | Supported | `createExtension`, `dropExtension` with `ifNotExists`, `schema`, `version`, `cascade`. | Guide · Example |
| Row-level security policies | 16+ | Supported | `enableRowLevelSecurity`, `disableRowLevelSecurity`, `createPolicy`, `alterPolicy`, `dropPolicy`; string conditions are trusted SQL, where objects are escaped. | Guide · Example |
| UNLOGGED and TEMPORARY tables | 16+ | Supported | `unlogged` and `temporary` options on `createTable` and on model options (`sync`); a temporary table lives in one session, so use a transaction. | Guide · Example |
| Rules (CREATE RULE) | 16+ | Out of scope | Legacy mechanism; triggers and views cover the use cases. |
Session features
| Feature | PG | Status | Notes | Docs |
|---|---|---|---|---|
| Transactions: managed, unmanaged, CLS, afterCommit hooks | 16+ | Supported | `sequelize.transaction()`. | same as v6 |
| Isolation levels | 16+ | Supported | `isolationLevel` option. | same as v6 |
| READ ONLY transactions | 16+ | Supported | `readOnly: true`. | Guide · Example |
| DEFERRABLE transaction mode (SERIALIZABLE READ ONLY DEFERRABLE) | 16+ | Supported | `deferrable` transaction option. | Guide · Example |
| Savepoints (nested transactions) | 16+ | Supported | A `transaction` option inside a transaction creates a savepoint. | same as v6 |
| Advisory locks | 16+ | Supported | `sequelize.withAdvisoryLock()`, `transaction.advisoryLock()`. | Guide · Example |
| LISTEN / NOTIFY | 16+ | Supported | `sequelize.listen()`, `sequelize.notify()` on a dedicated client. | Guide · Example |
| SET LOCAL settings (statement_timeout, lock_timeout, RLS variables, search_path) | 16+ | Supported | `settings` transaction option. | Guide · Example |
| Server-side cursors and streaming (findEach) | 16+ | Supported | `Model.findEach()`. | Guide · Example |
| COPY streaming with backpressure | 16+ | Supported | `copyTo` is an async iterable; `copyFrom` accepts async iterables. | Guide · Example |
| Read replicas | 16+ | Supported | `replication: { read, write }`, `useMaster`. | Guide · Example |
| Bound parameters and replacements in raw queries | 16+ | Supported | `sequelize.query()` with `bind` and `replacements`. | same as v6 |
| Named prepared statements | 16+ | Supported | `statementCache` option; opt-in, bounded per connection, ADR-023. | Guide · Example |
| SSL / TLS connections | 16+ | Via literal / raw | The `ssl` option and `dialectOptions` pass through to `pg`; no test runs against a TLS server. | |
| Per-query statement timeout | 16+ | Supported | `statementTimeout` query option (ms). | Guide · Example |
| EXPLAIN / EXPLAIN ANALYZE | 16+ | Via literal / raw | `sequelize.query("EXPLAIN (FORMAT JSON) …")`. | |
| Two-phase commit (PREPARE TRANSACTION) | 16+ | Out of scope | Needs a transaction manager outside the ORM. |
Out of scope
| Feature | PG | Status | Notes | Docs |
|---|---|---|---|---|
| Roles, GRANT / REVOKE, default privileges | 16+ | Out of scope | Server administration; use migrations with raw SQL or your infrastructure tooling. | |
| Replication setup (publications, subscriptions, slots, logical decoding) | 16+ | Out of scope | Operations concern, not data access. Replica reads are supported. | |
| Tablespaces | 16+ | Out of scope | Storage layout is an operations concern. | |
| VACUUM, ANALYZE, REINDEX, CLUSTER, pg_stat views | 16+ | Out of scope | Maintenance; run through a raw query when needed. | |
| Procedural languages (PL/pgSQL bodies, DO blocks, procedures) | 16+ | Out of scope | The ORM does not author server-side code; calling `fn()` works. Creating functions is tracked under DDL. | |
| Extension internals (writing or configuring extensions) | 16+ | Out of scope | Types and operators of popular extensions are covered above; their administration is not. | |
| Foreign data wrappers and foreign tables | 16+ | Out of scope | Server configuration; a foreign table can be modelled like a regular table. | |
| Server configuration (ALTER SYSTEM, pg_hba.conf, event triggers) | 16+ | Out of scope | Server administration. |
Closing the gaps
The rows marked Planned are grouped into proposed stages in the coverage review. To add or change a row, edit docs/coverage/postgresql-features.ts; a row becomes Supported only together with a test reference, a beyondV6 decision and, for features v6 lacks, an example and a guide link.