Optional
serde: SerializerProtocolOptional
options: Partial<PostgresSaverOptions>Protected
_dumpProtected
_dumpProtected
_dumpProtected
_dumpProtected
_loadProtected
_loadProtected
_loadProtected
_loadProtected
_searchReturn WHERE clause predicates for a given list() config, filter, cursor.
This method returns a tuple of a string and a tuple of values. The string is the parameterized WHERE clause predicate (including the WHERE keyword): "WHERE column1 = $1 AND column2 IS $2". The list of values contains the values for each of the corresponding parameters.
Optional
config: RunnableConfig<Record<string, any>>Optional
filter: Record<string, unknown>Optional
before: RunnableConfig<Record<string, any>>Generate the next version ID for a channel.
Default is to use integer versions, incrementing by 1. If you override, you can use str/int/float versions, as long as they are monotonically increasing.
Get a checkpoint tuple from the database. This method retrieves a checkpoint tuple from the Postgres database based on the provided config. If the config's configurable field contains a "checkpoint_id" key, the checkpoint with the matching thread_id and namespace is retrieved. Otherwise, the latest checkpoint for the given thread_id is retrieved.
The config to use for retrieving the checkpoint.
The retrieved checkpoint tuple, or undefined.
List checkpoints from the database.
This method retrieves a list of checkpoint tuples from the Postgres database based on the provided config. The checkpoints are ordered by checkpoint ID in descending order (newest first).
Optional
options: CheckpointListOptionsSave a checkpoint to the database.
This method saves a checkpoint to the Postgres database. The checkpoint is associated with the provided config and its parent config (if any).
Store intermediate writes linked to a checkpoint.
This method saves intermediate writes associated with a checkpoint to the Postgres database.
Configuration of the related checkpoint.
List of writes to store.
Identifier for the task creating the writes.
Set up the checkpoint database asynchronously.
This method creates the necessary tables in the Postgres database if they don't already exist and runs database migrations. It MUST be called directly by the user the first time checkpointer is used.
Static
fromCreates a new instance of PostgresSaver from a connection string.
The connection string to connect to the Postgres database.
Optional
options: Partial<PostgresSaverOptions>Optional configuration object.
A new instance of PostgresSaver.
LangGraph checkpointer that uses a Postgres instance as the backing store. Uses the node-postgres package internally to connect to a Postgres instance.
Example