Class PostgresJdbcSessionRepositoryDialect
java.lang.Object
org.springframework.ai.session.jdbc.PostgresJdbcSessionRepositoryDialect
- All Implemented Interfaces:
JdbcSessionRepositoryDialect
public class PostgresJdbcSessionRepositoryDialect
extends Object
implements JdbcSessionRepositoryDialect
The dialect of PostgreSQL.
- Since:
- 2.1.0
- Author:
- Christian Tzolov
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionInserts a row intoAI_SESSIONonly if its id does not exist, with the same four parameters asJdbcSessionRepositoryDialect.getUpsertSessionSql(): one row updated on insert, zero rows or a duplicate-key error when the id exists.Inserts a row intoAI_SESSIONor updates the existing one, refreshing onlyexpires_atandmetadata:created_atkeeps its value andevent_versionis never touched.
-
Constructor Details
-
PostgresJdbcSessionRepositoryDialect
public PostgresJdbcSessionRepositoryDialect()
-
-
Method Details
-
getUpsertSessionSql
Description copied from interface:JdbcSessionRepositoryDialectInserts a row intoAI_SESSIONor updates the existing one, refreshing onlyexpires_atandmetadata:created_atkeeps its value andevent_versionis never touched. Parameters, in order:id,created_at,expires_at,metadata.- Specified by:
getUpsertSessionSqlin interfaceJdbcSessionRepositoryDialect
-
getInsertSessionIfAbsentSql
Description copied from interface:JdbcSessionRepositoryDialectInserts a row intoAI_SESSIONonly if its id does not exist, with the same four parameters asJdbcSessionRepositoryDialect.getUpsertSessionSql(): one row updated on insert, zero rows or a duplicate-key error when the id exists. The default is a plainINSERT; a database whose failed statement aborts the enclosing transaction, PostgreSQL, uses a conflict-ignoring form.- Specified by:
getInsertSessionIfAbsentSqlin interfaceJdbcSessionRepositoryDialect
-