Skip to content

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.

StatusMeaning
SupportedA dedicated API exists and a test in this repository runs it against PostgreSQL.
Via literal / rawWorks through literal(), fn(), a raw sequelize.query() or a driver option; no helper.
PlannedA real gap an ORM should cover. Not implemented yet; the note shows the workaround.
Out of scopeServer administration or internals. The note gives the reason.

SELECT clauses

FeaturePGStatusNotesDocs
DISTINCT ON16+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 RECURSIVE16+Supported`with` find option.Guide · Example
CTE MATERIALIZED / NOT MATERIALIZED16+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 clauses16+Supported`search` and `cycle` in a recursive `with` definition; `cycle.using` is required.Guide · Example
LATERAL joins16+Supported`from: { alias: { lateral: subquery } }`; `lateral: true` on a `separate` include with `limit` reads the top rows per parent.Guide · Example
GROUPING SETS / ROLLUP / CUBE16+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 LOCKED16+Supported`lock`, `skipLocked`, `noWait` find options.same as v6
ORDER BY … NULLS FIRST / LAST16+SupportedOrder direction string, e.g. `["rank", "ASC NULLS LAST"]`.Guide · Example
TABLESAMPLE16+Supported`sample: { method, percent, seed }` find option and `{ model, sample }` in `from`.Guide · Example
FETCH FIRST … WITH TIES16+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 forms16+Via literal / rawPlain aggregates through `fn()`; `FILTER (WHERE …)` and `WITHIN GROUP` through `literal()`.
ONLY (table inheritance)16+Out of scopeLegacy inheritance; partitioning is the supported way to split tables.

DML

FeaturePGStatusNotesDocs
INSERT … ON CONFLICT DO NOTHING16+Supported`onConflict` with `action: "nothing"`.Guide · Example
ON CONFLICT DO UPDATE with expressions and inserted/updated flag16+Supported`onConflict` update action with `excluded()`; `Model.insert()` reports `wasInserted`.Guide · Example
ON CONFLICT DO UPDATE … WHERE16+Supported`where` of the `onConflict` update action.Guide · Example
ON CONFLICT ON CONSTRAINT, expression and partial-index targets16+Supported`onConflict` targets: `constraint`, columns or expressions, with `where`.Guide · Example
INSERT … OVERRIDING SYSTEM / USER VALUE16+Supported`overriding: "system" | "user"` write option.Guide · Example
INSERT … SELECT16+Supported`Model.insertFrom()`.Guide · Example
UPDATE … FROM and DELETE … USING16+Supported`from` option of `Model.update`, `using` option of `Model.destroy`.Guide · Example
UPDATE SET (a, b) = (sub-SELECT) and WHERE CURRENT OF16+Via literal / rawPer-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 SOURCE17+SupportedRejected before running on servers older than 17.Guide · Example
RETURNING on INSERT / UPDATE / DELETE16+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
TRUNCATE16+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 arrays16+Supported`bulkCreate(rows, { unnest: true })`.Guide · Example

Operators and functions

FeaturePGStatusNotesDocs
Comparison and logical operators (=, <>, <, >, BETWEEN, IN, IS NULL, AND/OR/NOT)16+Supported`Op.*` as in Sequelize v6.same as v6
IS [NOT] DISTINCT FROM16+Supported`Op.isDistinctFrom`, `Op.isNotDistinctFrom`.Guide · Example
= ANY($1) for long IN lists16+SupportedAutomatic above `inAsAnyThreshold`.Guide · Example
LIKE / ILIKE patterns16+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 TO16+Supported`Op.similarTo`, `Op.notSimilarTo`.Guide · Example
JSON / JSONB containment, nested paths and key-exists (@>, #>>, ?, ?|, ?&)16+SupportedNested `where` objects, `Op.contains`, `Op.hasKey`, `Op.hasAnyKeys`, `Op.hasAllKeys`.same as v6
jsonpath operators (@?, @@) and jsonb_path_* functions16+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 / rawThrough `literal()` in attributes or `where`.
JSON_TABLE17+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+SupportedRange 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 functions16+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 / rawEquality 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 / rawThrough `fn()` / `literal()`; the INTERVAL column type is supported.
Any SQL function or expression through fn(), cast(), col(), literal()16+SupportedFunction names pass an allowlist; `literal()` is raw by design.same as v6

Data types

FeaturePGStatusNotesDocs
smallint, integer, bigint, serial, identity16+Supported`SMALLINT`, `INTEGER`, `BIGINT` (returned as string), `autoIncrement` (serial or identity).same as v6
numeric / decimal, real, double precision16+Supported`DECIMAL(p, s)` returned as string; `REAL`, `DOUBLE`, `FLOAT`.same as v6
text, varchar, char, boolean16+Supported`TEXT`, `STRING(n)`, `CHAR(n)`, `BOOLEAN`.same as v6
timestamptz, date, time16+Supported`DATE` (timestamptz), `DATEONLY`, `TIME`.same as v6
timestamp without time zone16+Supported`DataTypes.TIMESTAMP(fsp?)`; values are `Date`s with the local wall-clock time.Guide · Example
interval16+Supported`DataTypes.INTERVAL`.Guide · Example
money16+Supported`DataTypes.MONEY`; read as the server formats it (`lc_monetary`, e.g. `$12.50`); write numbers or strings.Guide · Example
bytea16+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 types16+Supported`DataTypes.COMPOSITE(name, fields)` with object values; `createSql()` renders `CREATE TYPE`; array fields are not supported.Guide · Example
domains16+Via literal / rawCreate 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 types16+Supported`DataTypes.MULTIRANGE(type)` (PostgreSQL 14+) with arrays of `[lower, upper]` ranges.Guide · Example
json and jsonb16+Supported`DataTypes.JSON`, `DataTypes.JSONB`.same as v6
xml16+Supported`DataTypes.XML`; values are XML text; `xpath()` through `literal()` / `fn()`.Guide · Example
bit and bit varying16+Supported`DataTypes.BIT(n)`, `DataTypes.VARBIT(n)`; values are strings of `0` and `1`.Guide · Example
uuid16+Supported`DataTypes.UUID` with `UUIDV4` client default.same as v6
inet, cidr, macaddr16+Supported`DataTypes.INET`, `CIDR`, `MACADDR`.same as v6
macaddr816+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
tsvector16+Supported`DataTypes.TSVECTOR`.same as v6
tsquery16+Supported`DataTypes.TSQUERY`; values are query strings (`'fat' & 'rat'`).Guide · Example
pg_lsn, txid_snapshot and other system types16+Out of scopeReplication 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 / geography16+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 columns16+Supported`generated: { as, stored }` and `identity: "always" | "byDefault"` column options. `VIRTUAL` generated columns need PostgreSQL 18.Guide · Example

DDL (sync and QueryInterface)

FeaturePGStatusNotesDocs
Tables from models (sync, force, alter) and createTable / dropTable16+Supported`sequelize.sync()`, `QueryInterface.createTable()`.same as v6
Primary key, unique, check and foreign-key constraints with referential actions16+Supported`addConstraint`, column `references`, `onDelete`, `onUpdate`.same as v6
DEFERRABLE constraints16+Supported`Deferrable` values on `references`.same as v6
UNIQUE NULLS NOT DISTINCT16+Supported`nullsNotDistinct` on unique columns, constraints and indexes.Guide · Example
EXCLUDE constraints16+Supported`addConstraint({ type: 'exclude', exclude: [{ name | expression, with }], using, where, include, deferrable })`; violations raise `ExclusionConstraintError`.Guide · Example
NOT VALID constraints and VALIDATE CONSTRAINT16+Supported`notValid` on check and foreign key constraints, `validateConstraint`.Guide · Example
NOT ENFORCED constraints, WITHOUT OVERLAPS keys, FK PERIOD18+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 EXISTS16+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 table16+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 columns16+Supported`comment` option on `createTable` and columns.same as v6
Schemas16+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 views16+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 triggers16+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 policies16+Supported`enableRowLevelSecurity`, `disableRowLevelSecurity`, `createPolicy`, `alterPolicy`, `dropPolicy`; string conditions are trusted SQL, where objects are escaped.Guide · Example
UNLOGGED and TEMPORARY tables16+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 scopeLegacy mechanism; triggers and views cover the use cases.

Session features

FeaturePGStatusNotesDocs
Transactions: managed, unmanaged, CLS, afterCommit hooks16+Supported`sequelize.transaction()`.same as v6
Isolation levels16+Supported`isolationLevel` option.same as v6
READ ONLY transactions16+Supported`readOnly: true`.Guide · Example
DEFERRABLE transaction mode (SERIALIZABLE READ ONLY DEFERRABLE)16+Supported`deferrable` transaction option.Guide · Example
Savepoints (nested transactions)16+SupportedA `transaction` option inside a transaction creates a savepoint.same as v6
Advisory locks16+Supported`sequelize.withAdvisoryLock()`, `transaction.advisoryLock()`.Guide · Example
LISTEN / NOTIFY16+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 backpressure16+Supported`copyTo` is an async iterable; `copyFrom` accepts async iterables.Guide · Example
Read replicas16+Supported`replication: { read, write }`, `useMaster`.Guide · Example
Bound parameters and replacements in raw queries16+Supported`sequelize.query()` with `bind` and `replacements`.same as v6
Named prepared statements16+Supported`statementCache` option; opt-in, bounded per connection, ADR-023.Guide · Example
SSL / TLS connections16+Via literal / rawThe `ssl` option and `dialectOptions` pass through to `pg`; no test runs against a TLS server.
Per-query statement timeout16+Supported`statementTimeout` query option (ms).Guide · Example
EXPLAIN / EXPLAIN ANALYZE16+Via literal / raw`sequelize.query("EXPLAIN (FORMAT JSON) …")`.
Two-phase commit (PREPARE TRANSACTION)16+Out of scopeNeeds a transaction manager outside the ORM.

Out of scope

FeaturePGStatusNotesDocs
Roles, GRANT / REVOKE, default privileges16+Out of scopeServer administration; use migrations with raw SQL or your infrastructure tooling.
Replication setup (publications, subscriptions, slots, logical decoding)16+Out of scopeOperations concern, not data access. Replica reads are supported.
Tablespaces16+Out of scopeStorage layout is an operations concern.
VACUUM, ANALYZE, REINDEX, CLUSTER, pg_stat views16+Out of scopeMaintenance; run through a raw query when needed.
Procedural languages (PL/pgSQL bodies, DO blocks, procedures)16+Out of scopeThe 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 scopeTypes and operators of popular extensions are covered above; their administration is not.
Foreign data wrappers and foreign tables16+Out of scopeServer configuration; a foreign table can be modelled like a regular table.
Server configuration (ALTER SYSTEM, pg_hba.conf, event triggers)16+Out of scopeServer 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.

Released under the MIT License.