sql-kit
sql-kit copied to clipboard
transaction
What the true way to use transaction with async/await style?
Any examples?
I don't think SQLKit supports transactions as it's not really the focus of the library. You can start a transaction directly in a database connection with a BEGIN query, then the SQLKit code, then a COMMIT/ROLLBACK
Any chance at another look at this? I tried 'rolling my own' transaction wrapper and it didn't work and seems to have actually 'failed successfully' .. request returns success but only the first query in the transaction appears to have actually worked.
this is my attempt:
struct Database {
let sql: SQLDatabase
func transaction<T>(_ operations: (SQLDatabase) async throws -> T) async throws -> T {
do {
try await sql.raw("BEGIN;").run()
let result = try await operations(sql)
try await sql.raw("COMMIT;").run()
return result
} catch let error {
try await sql.raw("ROLLBACK;").run()
throw error
}
}
}
Which I use like:
return try await db.transaction { sql in
let item = ItemRecord(...)
try await sql.insert(item).run()
let join = SomeJoinRecord(item, ...)
try await sql.insert(join).run()
return item
}
The item is inserted but the join is not.
Here is a trace from the code in production:
Trace log
Dec 12 12:42:45 PM [ codes.vapor.application ] [ TRACE ] Run action [database-id: psql, psql_connection_action: sendParseDescribeBindExecuteSync(PostgresNIO.PostgresQuery(sql: "BEGIN;", binds: PostgresNIO.PostgresBindings(metadata: [], bytes: ByteBuffer { readerIndex: 0, writerIndex: 0, readableBytes: 0, capacity: 0, storageCapacity: 0, slice: _ByteBufferSlice { 0..<0 }, storage: 0x00007f7fd00317f0 (0 bytes) }))), psql_connection_id: 1, request-id: C5A16D36-1FCD-4B3C-8AF6-EF6A3C9FAC9B] (PostgresNIO/New/PostgresChannelHandler.swift:217)
Dec 12 12:42:45 PM [ codes.vapor.application ] [ TRACE ] Backend message received [database-id: psql, psql_connection_id: 1, psql_message: .parseComplete, request-id: C5A16D36-1FCD-4B3C-8AF6-EF6A3C9FAC9B] (PostgresNIO/New/PostgresChannelHandler.swift:103)
Dec 12 12:42:45 PM [ codes.vapor.application ] [ TRACE ] Run action [database-id: psql, psql_connection_action: wait, psql_connection_id: 1, request-id: C5A16D36-1FCD-4B3C-8AF6-EF6A3C9FAC9B] (PostgresNIO/New/PostgresChannelHandler.swift:217)
Dec 12 12:42:45 PM [ codes.vapor.application ] [ TRACE ] Backend message received [database-id: psql, psql_connection_id: 1, psql_message: .parameterDescription(PostgresNIO.PostgresBackendMessage.ParameterDescription(dataTypes: [])), request-id: C5A16D36-1FCD-4B3C-8AF6-EF6A3C9FAC9B] (PostgresNIO/New/PostgresChannelHandler.swift:103)
Dec 12 12:42:45 PM [ codes.vapor.application ] [ TRACE ] Run action [database-id: psql, psql_connection_action: wait, psql_connection_id: 1, request-id: C5A16D36-1FCD-4B3C-8AF6-EF6A3C9FAC9B] (PostgresNIO/New/PostgresChannelHandler.swift:217)
Dec 12 12:42:45 PM [ codes.vapor.application ] [ TRACE ] Backend message received [database-id: psql, psql_connection_id: 1, psql_message: .noData, request-id: C5A16D36-1FCD-4B3C-8AF6-EF6A3C9FAC9B] (PostgresNIO/New/PostgresChannelHandler.swift:103)
Dec 12 12:42:45 PM [ codes.vapor.application ] [ TRACE ] Run action [database-id: psql, psql_connection_action: wait, psql_connection_id: 1, request-id: C5A16D36-1FCD-4B3C-8AF6-EF6A3C9FAC9B] (PostgresNIO/New/PostgresChannelHandler.swift:217)
Dec 12 12:42:45 PM [ codes.vapor.application ] [ TRACE ] Backend message received [database-id: psql, psql_connection_id: 1, psql_message: .bindComplete, request-id: C5A16D36-1FCD-4B3C-8AF6-EF6A3C9FAC9B] (PostgresNIO/New/PostgresChannelHandler.swift:103)
Dec 12 12:42:45 PM [ codes.vapor.application ] [ TRACE ] Run action [database-id: psql, psql_connection_action: wait, psql_connection_id: 1, request-id: C5A16D36-1FCD-4B3C-8AF6-EF6A3C9FAC9B] (PostgresNIO/New/PostgresChannelHandler.swift:217)
Dec 12 12:42:45 PM [ codes.vapor.application ] [ TRACE ] Backend message received [database-id: psql, psql_connection_id: 1, psql_message: .commandComplete("BEGIN"), request-id: C5A16D36-1FCD-4B3C-8AF6-EF6A3C9FAC9B] (PostgresNIO/New/PostgresChannelHandler.swift:103)
Dec 12 12:42:45 PM [ codes.vapor.application ] [ TRACE ] Run action [database-id: psql, psql_connection_action: succeedQueryNoRowsComming(PostgresNIO.ExtendedQueryContext, commandTag: "BEGIN"), psql_connection_id: 1, request-id: C5A16D36-1FCD-4B3C-8AF6-EF6A3C9FAC9B] (PostgresNIO/New/PostgresChannelHandler.swift:217)
Dec 12 12:42:45 PM [ codes.vapor.application ] [ TRACE ] Releasing connection [database-id: psql, request-id: AFB803A2-F227-4291-BA93-12C55F964B93] (AsyncKit/ConnectionPool/EventLoopConnectionPool.swift:262)
Dec 12 12:42:45 PM [ codes.vapor.application ] [ TRACE ] Backend message received [database-id: psql, psql_connection_id: 1, psql_message: .readyForQuery(.inTransaction), request-id: C5A16D36-1FCD-4B3C-8AF6-EF6A3C9FAC9B] (PostgresNIO/New/PostgresChannelHandler.swift:103)
Dec 12 12:42:45 PM [ codes.vapor.application ] [ TRACE ] Run action [database-id: psql, psql_connection_action: fireEventReadyForQuery, psql_connection_id: 1, request-id: C5A16D36-1FCD-4B3C-8AF6-EF6A3C9FAC9B] (PostgresNIO/New/PostgresChannelHandler.swift:217)
Dec 12 12:42:45 PM [ codes.vapor.application ] [ TRACE ] Run action [database-id: psql, psql_connection_action: wait, psql_connection_id: 1, request-id: C5A16D36-1FCD-4B3C-8AF6-EF6A3C9FAC9B] (PostgresNIO/New/PostgresChannelHandler.swift:217)
Dec 12 12:42:45 PM [ codes.vapor.application ] [ TRACE ] Channel read event received [database-id: psql, psql_connection_id: 1, request-id: C5A16D36-1FCD-4B3C-8AF6-EF6A3C9FAC9B] (PostgresNIO/New/PostgresChannelHandler.swift:179)
Dec 12 12:42:45 PM [ codes.vapor.application ] [ TRACE ] Run action [database-id: psql, psql_connection_action: read, psql_connection_id: 1, request-id: C5A16D36-1FCD-4B3C-8AF6-EF6A3C9FAC9B] (PostgresNIO/New/PostgresChannelHandler.swift:217)
Dec 12 12:42:45 PM [ codes.vapor.application ] [ TRACE ] Re-using available connection [database-id: psql, request-id: AFB803A2-F227-4291-BA93-12C55F964B93] (AsyncKit/ConnectionPool/EventLoopConnectionPool.swift:191)
Dec 12 12:42:45 PM [ codes.vapor.application ] [ TRACE ] Run action [database-id: psql, psql_connection_action: sendParseDescribeBindExecuteSync(PostgresNIO.PostgresQuery(sql: "INSERT INTO \"Items\" (\"id\", \"created\", \"userId\", \"visibility\", \"name\", \"price\", \"notes\", \"attributes\") VALUES ($1, $2, $3, $4, $5, $6, $7, $8)", binds: PostgresNIO.PostgresBindings(metadata: [PostgresNIO.PostgresBindings.Metadata(dataType: TEXT, format: binary), PostgresNIO.PostgresBindings.Metadata(dataType: TIMESTAMPTZ, format: binary), PostgresNIO.PostgresBindings.Metadata(dataType: TEXT, format: binary), PostgresNIO.PostgresBindings.Metadata(dataType: TEXT, format: binary), PostgresNIO.PostgresBindings.Metadata(dataType: TEXT, format: binary), PostgresNIO.PostgresBindings.Metadata(dataType: NUMERIC, format: binary), PostgresNIO.PostgresBindings.Metadata(dataType: TEXT, format: binary), PostgresNIO.PostgresBindings.Metadata(dataType: TEXT, format: binary)], bytes: ByteBuffer { readerIndex: 0, writerIndex: 139, readableBytes: 139, capacity: 1024, storageCapacity: 1024, slice: _ByteBufferSlice { 0..<1024 }, storage: 0x00007f7ed400fa30 (1024 bytes) }))), psql_connection_id: 1, request-id: C5A16D36-1FCD-4B3C-8AF6-EF6A3C9FAC9B] (PostgresNIO/New/PostgresChannelHandler.swift:217)
Dec 12 12:42:45 PM [ codes.vapor.application ] [ TRACE ] Backend message received [database-id: psql, psql_connection_id: 1, psql_message: .parseComplete, request-id: C5A16D36-1FCD-4B3C-8AF6-EF6A3C9FAC9B] (PostgresNIO/New/PostgresChannelHandler.swift:103)
Dec 12 12:42:45 PM [ codes.vapor.application ] [ TRACE ] Run action [database-id: psql, psql_connection_action: wait, psql_connection_id: 1, request-id: C5A16D36-1FCD-4B3C-8AF6-EF6A3C9FAC9B] (PostgresNIO/New/PostgresChannelHandler.swift:217)
Dec 12 12:42:45 PM [ codes.vapor.application ] [ TRACE ] Backend message received [database-id: psql, psql_connection_id: 1, psql_message: .parameterDescription(PostgresNIO.PostgresBackendMessage.ParameterDescription(dataTypes: [TEXT, TIMESTAMPTZ, TEXT, TEXT, TEXT, NUMERIC, TEXT, TEXT])), request-id: C5A16D36-1FCD-4B3C-8AF6-EF6A3C9FAC9B] (PostgresNIO/New/PostgresChannelHandler.swift:103)
Dec 12 12:42:45 PM [ codes.vapor.application ] [ TRACE ] Run action [database-id: psql, psql_connection_action: wait, psql_connection_id: 1, request-id: C5A16D36-1FCD-4B3C-8AF6-EF6A3C9FAC9B] (PostgresNIO/New/PostgresChannelHandler.swift:217)
Dec 12 12:42:45 PM [ codes.vapor.application ] [ TRACE ] Backend message received [database-id: psql, psql_connection_id: 1, psql_message: .noData, request-id: C5A16D36-1FCD-4B3C-8AF6-EF6A3C9FAC9B] (PostgresNIO/New/PostgresChannelHandler.swift:103)
Dec 12 12:42:45 PM [ codes.vapor.application ] [ TRACE ] Run action [database-id: psql, psql_connection_action: wait, psql_connection_id: 1, request-id: C5A16D36-1FCD-4B3C-8AF6-EF6A3C9FAC9B] (PostgresNIO/New/PostgresChannelHandler.swift:217)
Dec 12 12:42:45 PM [ codes.vapor.application ] [ TRACE ] Backend message received [database-id: psql, psql_connection_id: 1, psql_message: .bindComplete, request-id: C5A16D36-1FCD-4B3C-8AF6-EF6A3C9FAC9B] (PostgresNIO/New/PostgresChannelHandler.swift:103)
Dec 12 12:42:45 PM [ codes.vapor.application ] [ TRACE ] Run action [database-id: psql, psql_connection_action: wait, psql_connection_id: 1, request-id: C5A16D36-1FCD-4B3C-8AF6-EF6A3C9FAC9B] (PostgresNIO/New/PostgresChannelHandler.swift:217)
Dec 12 12:42:45 PM [ codes.vapor.application ] [ TRACE ] Backend message received [database-id: psql, psql_connection_id: 1, psql_message: .commandComplete("INSERT 0 1"), request-id: C5A16D36-1FCD-4B3C-8AF6-EF6A3C9FAC9B] (PostgresNIO/New/PostgresChannelHandler.swift:103)
Dec 12 12:42:45 PM [ codes.vapor.application ] [ TRACE ] Run action [database-id: psql, psql_connection_action: succeedQueryNoRowsComming(PostgresNIO.ExtendedQueryContext, commandTag: "INSERT 0 1"), psql_connection_id: 1, request-id: C5A16D36-1FCD-4B3C-8AF6-EF6A3C9FAC9B] (PostgresNIO/New/PostgresChannelHandler.swift:217)
Dec 12 12:42:45 PM [ codes.vapor.application ] [ TRACE ] Releasing connection [database-id: psql, request-id: AFB803A2-F227-4291-BA93-12C55F964B93] (AsyncKit/ConnectionPool/EventLoopConnectionPool.swift:262)
Dec 12 12:42:45 PM [ codes.vapor.application ] [ TRACE ] Backend message received [database-id: psql, psql_connection_id: 1, psql_message: .readyForQuery(.inTransaction), request-id: C5A16D36-1FCD-4B3C-8AF6-EF6A3C9FAC9B] (PostgresNIO/New/PostgresChannelHandler.swift:103)
Dec 12 12:42:45 PM [ codes.vapor.application ] [ TRACE ] Run action [database-id: psql, psql_connection_action: fireEventReadyForQuery, psql_connection_id: 1, request-id: C5A16D36-1FCD-4B3C-8AF6-EF6A3C9FAC9B] (PostgresNIO/New/PostgresChannelHandler.swift:217)
Dec 12 12:42:45 PM [ codes.vapor.application ] [ TRACE ] Run action [database-id: psql, psql_connection_action: wait, psql_connection_id: 1, request-id: C5A16D36-1FCD-4B3C-8AF6-EF6A3C9FAC9B] (PostgresNIO/New/PostgresChannelHandler.swift:217)
Dec 12 12:42:45 PM [ codes.vapor.application ] [ TRACE ] Channel read event received [database-id: psql, psql_connection_id: 1, request-id: C5A16D36-1FCD-4B3C-8AF6-EF6A3C9FAC9B] (PostgresNIO/New/PostgresChannelHandler.swift:179)
Dec 12 12:42:45 PM [ codes.vapor.application ] [ TRACE ] Run action [database-id: psql, psql_connection_action: read, psql_connection_id: 1, request-id: C5A16D36-1FCD-4B3C-8AF6-EF6A3C9FAC9B] (PostgresNIO/New/PostgresChannelHandler.swift:217)
Dec 12 12:42:45 PM [ codes.vapor.application ] [ TRACE ] Re-using available connection [database-id: psql, request-id: AFB803A2-F227-4291-BA93-12C55F964B93] (AsyncKit/ConnectionPool/EventLoopConnectionPool.swift:191)
Dec 12 12:42:45 PM [ codes.vapor.application ] [ TRACE ] Run action [database-id: psql, psql_connection_action: sendParseDescribeBindExecuteSync(PostgresNIO.PostgresQuery(sql: "INSERT INTO \"FriendItems\" (\"id\", \"friendId\", \"itemId\", \"lookupId\") VALUES ($1, $2, $3, $4)", binds: PostgresNIO.PostgresBindings(metadata: [PostgresNIO.PostgresBindings.Metadata(dataType: TEXT, format: binary), PostgresNIO.PostgresBindings.Metadata(dataType: TEXT, format: binary), PostgresNIO.PostgresBindings.Metadata(dataType: TEXT, format: binary), PostgresNIO.PostgresBindings.Metadata(dataType: TEXT, format: binary)], bytes: ByteBuffer { readerIndex: 0, writerIndex: 188, readableBytes: 188, capacity: 512, storageCapacity: 512, slice: _ByteBufferSlice { 0..<512 }, storage: 0x00007f7ed8007fe0 (512 bytes) }))), psql_connection_id: 1, request-id: C5A16D36-1FCD-4B3C-8AF6-EF6A3C9FAC9B] (PostgresNIO/New/PostgresChannelHandler.swift:217)
Dec 12 12:42:45 PM [ codes.vapor.application ] [ TRACE ] Backend message received [database-id: psql, psql_connection_id: 1, psql_message: .parseComplete, request-id: C5A16D36-1FCD-4B3C-8AF6-EF6A3C9FAC9B] (PostgresNIO/New/PostgresChannelHandler.swift:103)
Dec 12 12:42:45 PM [ codes.vapor.application ] [ TRACE ] Run action [database-id: psql, psql_connection_action: wait, psql_connection_id: 1, request-id: C5A16D36-1FCD-4B3C-8AF6-EF6A3C9FAC9B] (PostgresNIO/New/PostgresChannelHandler.swift:217)
Dec 12 12:42:45 PM [ codes.vapor.application ] [ TRACE ] Backend message received [database-id: psql, psql_connection_id: 1, psql_message: .parameterDescription(PostgresNIO.PostgresBackendMessage.ParameterDescription(dataTypes: [TEXT, TEXT, TEXT, TEXT])), request-id: C5A16D36-1FCD-4B3C-8AF6-EF6A3C9FAC9B] (PostgresNIO/New/PostgresChannelHandler.swift:103)
Dec 12 12:42:45 PM [ codes.vapor.application ] [ TRACE ] Run action [database-id: psql, psql_connection_action: wait, psql_connection_id: 1, request-id: C5A16D36-1FCD-4B3C-8AF6-EF6A3C9FAC9B] (PostgresNIO/New/PostgresChannelHandler.swift:217)
Dec 12 12:42:45 PM [ codes.vapor.application ] [ TRACE ] Backend message received [database-id: psql, psql_connection_id: 1, psql_message: .noData, request-id: C5A16D36-1FCD-4B3C-8AF6-EF6A3C9FAC9B] (PostgresNIO/New/PostgresChannelHandler.swift:103)
Dec 12 12:42:45 PM [ codes.vapor.application ] [ TRACE ] Run action [database-id: psql, psql_connection_action: wait, psql_connection_id: 1, request-id: C5A16D36-1FCD-4B3C-8AF6-EF6A3C9FAC9B] (PostgresNIO/New/PostgresChannelHandler.swift:217)
Dec 12 12:42:45 PM [ codes.vapor.application ] [ TRACE ] Backend message received [database-id: psql, psql_connection_id: 1, psql_message: .bindComplete, request-id: C5A16D36-1FCD-4B3C-8AF6-EF6A3C9FAC9B] (PostgresNIO/New/PostgresChannelHandler.swift:103)
Dec 12 12:42:45 PM [ codes.vapor.application ] [ TRACE ] Run action [database-id: psql, psql_connection_action: wait, psql_connection_id: 1, request-id: C5A16D36-1FCD-4B3C-8AF6-EF6A3C9FAC9B] (PostgresNIO/New/PostgresChannelHandler.swift:217)
Dec 12 12:42:45 PM [ codes.vapor.application ] [ TRACE ] Backend message received [database-id: psql, psql_connection_id: 1, psql_message: .commandComplete("INSERT 0 1"), request-id: C5A16D36-1FCD-4B3C-8AF6-EF6A3C9FAC9B] (PostgresNIO/New/PostgresChannelHandler.swift:103)
Dec 12 12:42:45 PM [ codes.vapor.application ] [ TRACE ] Run action [database-id: psql, psql_connection_action: succeedQueryNoRowsComming(PostgresNIO.ExtendedQueryContext, commandTag: "INSERT 0 1"), psql_connection_id: 1, request-id: C5A16D36-1FCD-4B3C-8AF6-EF6A3C9FAC9B] (PostgresNIO/New/PostgresChannelHandler.swift:217)
Dec 12 12:42:45 PM [ codes.vapor.application ] [ TRACE ] Releasing connection [database-id: psql, request-id: AFB803A2-F227-4291-BA93-12C55F964B93] (AsyncKit/ConnectionPool/EventLoopConnectionPool.swift:262)
Dec 12 12:42:45 PM [ codes.vapor.application ] [ TRACE ] Backend message received [database-id: psql, psql_connection_id: 1, psql_message: .readyForQuery(.inTransaction), request-id: C5A16D36-1FCD-4B3C-8AF6-EF6A3C9FAC9B] (PostgresNIO/New/PostgresChannelHandler.swift:103)
Dec 12 12:42:45 PM [ codes.vapor.application ] [ TRACE ] Run action [database-id: psql, psql_connection_action: fireEventReadyForQuery, psql_connection_id: 1, request-id: C5A16D36-1FCD-4B3C-8AF6-EF6A3C9FAC9B] (PostgresNIO/New/PostgresChannelHandler.swift:217)
Dec 12 12:42:45 PM [ codes.vapor.application ] [ TRACE ] Run action [database-id: psql, psql_connection_action: wait, psql_connection_id: 1, request-id: C5A16D36-1FCD-4B3C-8AF6-EF6A3C9FAC9B] (PostgresNIO/New/PostgresChannelHandler.swift:217)
Dec 12 12:42:45 PM [ codes.vapor.application ] [ TRACE ] Channel read event received [database-id: psql, psql_connection_id: 1, request-id: C5A16D36-1FCD-4B3C-8AF6-EF6A3C9FAC9B] (PostgresNIO/New/PostgresChannelHandler.swift:179)
Dec 12 12:42:45 PM [ codes.vapor.application ] [ TRACE ] Run action [database-id: psql, psql_connection_action: read, psql_connection_id: 1, request-id: C5A16D36-1FCD-4B3C-8AF6-EF6A3C9FAC9B] (PostgresNIO/New/PostgresChannelHandler.swift:217)
Dec 12 12:42:45 PM [ codes.vapor.application ] [ TRACE ] Re-using available connection [database-id: psql, request-id: AFB803A2-F227-4291-BA93-12C55F964B93] (AsyncKit/ConnectionPool/EventLoopConnectionPool.swift:191)
Dec 12 12:42:45 PM [ codes.vapor.application ] [ TRACE ] Run action [database-id: psql, psql_connection_action: sendParseDescribeBindExecuteSync(PostgresNIO.PostgresQuery(sql: "COMMIT;", binds: PostgresNIO.PostgresBindings(metadata: [], bytes: ByteBuffer { readerIndex: 0, writerIndex: 0, readableBytes: 0, capacity: 0, storageCapacity: 0, slice: _ByteBufferSlice { 0..<0 }, storage: 0x00007f7fd00317f0 (0 bytes) }))), psql_connection_id: 1, request-id: C5A16D36-1FCD-4B3C-8AF6-EF6A3C9FAC9B] (PostgresNIO/New/PostgresChannelHandler.swift:217)
Dec 12 12:42:45 PM [ codes.vapor.application ] [ TRACE ] Backend message received [database-id: psql, psql_connection_id: 1, psql_message: .parseComplete, request-id: C5A16D36-1FCD-4B3C-8AF6-EF6A3C9FAC9B] (PostgresNIO/New/PostgresChannelHandler.swift:103)
Dec 12 12:42:45 PM [ codes.vapor.application ] [ TRACE ] Run action [database-id: psql, psql_connection_action: wait, psql_connection_id: 1, request-id: C5A16D36-1FCD-4B3C-8AF6-EF6A3C9FAC9B] (PostgresNIO/New/PostgresChannelHandler.swift:217)
Dec 12 12:42:45 PM [ codes.vapor.application ] [ TRACE ] Backend message received [database-id: psql, psql_connection_id: 1, psql_message: .parameterDescription(PostgresNIO.PostgresBackendMessage.ParameterDescription(dataTypes: [])), request-id: C5A16D36-1FCD-4B3C-8AF6-EF6A3C9FAC9B] (PostgresNIO/New/PostgresChannelHandler.swift:103)
Dec 12 12:42:45 PM [ codes.vapor.application ] [ TRACE ] Run action [database-id: psql, psql_connection_action: wait, psql_connection_id: 1, request-id: C5A16D36-1FCD-4B3C-8AF6-EF6A3C9FAC9B] (PostgresNIO/New/PostgresChannelHandler.swift:217)
Dec 12 12:42:45 PM [ codes.vapor.application ] [ TRACE ] Backend message received [database-id: psql, psql_connection_id: 1, psql_message: .noData, request-id: C5A16D36-1FCD-4B3C-8AF6-EF6A3C9FAC9B] (PostgresNIO/New/PostgresChannelHandler.swift:103)
Dec 12 12:42:45 PM [ codes.vapor.application ] [ TRACE ] Run action [database-id: psql, psql_connection_action: wait, psql_connection_id: 1, request-id: C5A16D36-1FCD-4B3C-8AF6-EF6A3C9FAC9B] (PostgresNIO/New/PostgresChannelHandler.swift:217)
Dec 12 12:42:45 PM [ codes.vapor.application ] [ TRACE ] Backend message received [database-id: psql, psql_connection_id: 1, psql_message: .bindComplete, request-id: C5A16D36-1FCD-4B3C-8AF6-EF6A3C9FAC9B] (PostgresNIO/New/PostgresChannelHandler.swift:103)
Dec 12 12:42:45 PM [ codes.vapor.application ] [ TRACE ] Run action [database-id: psql, psql_connection_action: wait, psql_connection_id: 1, request-id: C5A16D36-1FCD-4B3C-8AF6-EF6A3C9FAC9B] (PostgresNIO/New/PostgresChannelHandler.swift:217)
Dec 12 12:42:45 PM [ codes.vapor.application ] [ TRACE ] Backend message received [database-id: psql, psql_connection_id: 1, psql_message: .commandComplete("COMMIT"), request-id: C5A16D36-1FCD-4B3C-8AF6-EF6A3C9FAC9B] (PostgresNIO/New/PostgresChannelHandler.swift:103)
Dec 12 12:42:45 PM [ codes.vapor.application ] [ TRACE ] Run action [database-id: psql, psql_connection_action: succeedQueryNoRowsComming(PostgresNIO.ExtendedQueryContext, commandTag: "COMMIT"), psql_connection_id: 1, request-id: C5A16D36-1FCD-4B3C-8AF6-EF6A3C9FAC9B] (PostgresNIO/New/PostgresChannelHandler.swift:217)
Dec 12 12:42:45 PM [ codes.vapor.application ] [ TRACE ] Releasing connection [database-id: psql, request-id: AFB803A2-F227-4291-BA93-12C55F964B93] (AsyncKit/ConnectionPool/EventLoopConnectionPool.swift:262)
Dec 12 12:42:45 PM [ codes.vapor.application ] [ TRACE ] Backend message received [database-id: psql, psql_connection_id: 1, psql_message: .readyForQuery(.idle), request-id: C5A16D36-1FCD-4B3C-8AF6-EF6A3C9FAC9B] (PostgresNIO/New/PostgresChannelHandler.swift:103)
Dec 12 12:42:45 PM [ codes.vapor.application ] [ TRACE ] Run action [database-id: psql, psql_connection_action: fireEventReadyForQuery, psql_connection_id: 1, request-id: C5A16D36-1FCD-4B3C-8AF6-EF6A3C9FAC9B] (PostgresNIO/New/PostgresChannelHandler.swift:217)
Dec 12 12:42:45 PM [ codes.vapor.application ] [ TRACE ] Run action [database-id: psql, psql_connection_action: wait, psql_connection_id: 1, request-id: C5A16D36-1FCD-4B3C-8AF6-EF6A3C9FAC9B] (PostgresNIO/New/PostgresChannelHandler.swift:217)
Dec 12 12:42:45 PM [ codes.vapor.application ] [ TRACE ] Channel read event received [database-id: psql, psql_connection_id: 1, request-id: C5A16D36-1FCD-4B3C-8AF6-EF6A3C9FAC9B] (PostgresNIO/New/PostgresChannelHandler.swift:179)
Dec 12 12:42:45 PM [ codes.vapor.application ] [ TRACE ] Run action [database-id: psql, psql_connection_action: read, psql_connection_id: 1, request-id: C5A16D36-1FCD-4B3C-8AF6-EF6A3C9FAC9B] (PostgresNIO/New/PostgresChannelHandler.swift:217)