Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions async_postgres/pg_client.nim
Original file line number Diff line number Diff line change
Expand Up @@ -1127,7 +1127,7 @@ proc query*(
qr = await queryInlineImpl(conn, sql, data, ranges, oids, formats, resultFormats)
return qr

proc queryOne*(
proc queryRowOpt*(
conn: PgConnection,
sql: string,
params: seq[PgParam] = @[],
Expand All @@ -1153,7 +1153,7 @@ proc queryRow*(
## Execute a query and return the first row.
## Raises `PgError` if no rows are returned.
let row =
await conn.queryOne(sql, params, resultFormat = resultFormat, timeout = timeout)
await conn.queryRowOpt(sql, params, resultFormat = resultFormat, timeout = timeout)
if row.isNone:
raise newException(PgError, "Query returned no rows")
return row.get
Expand Down
4 changes: 2 additions & 2 deletions async_postgres/pg_pool.nim
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,7 @@ proc queryEach*(
await pool.resetSession(conn)
pool.release(conn)

proc queryOne*(
proc queryRowOpt*(
pool: PgPool,
sql: string,
params: seq[PgParam] = @[],
Expand All @@ -698,7 +698,7 @@ proc queryRow*(
## Execute a query and return the first row.
## Raises `PgError` if no rows are returned.
let row =
await pool.queryOne(sql, params, resultFormat = resultFormat, timeout = timeout)
await pool.queryRowOpt(sql, params, resultFormat = resultFormat, timeout = timeout)
if row.isNone:
raise newException(PgError, "Query returned no rows")
return row.get
Expand Down
4 changes: 2 additions & 2 deletions async_postgres/pg_pool_cluster.nim
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ clusterForwards("read"):
timeout: Duration = ZeroDuration,
): Future[QueryResult]

proc readQueryOne*(
proc readQueryRowOpt*(
cluster: PgPoolCluster,
sql: string,
params: seq[PgParam] = @[],
Expand Down Expand Up @@ -339,7 +339,7 @@ clusterForwards("write"):
timeout: Duration = ZeroDuration,
): Future[QueryResult]

proc writeQueryOne*(
proc writeQueryRowOpt*(
cluster: PgPoolCluster,
sql: string,
params: seq[PgParam] = @[],
Expand Down
8 changes: 4 additions & 4 deletions async_postgres/pg_sql.nim
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ sqlQueryForwards:
timeout: Duration = ZeroDuration,
): untyped

proc queryOne*(
proc queryRowOpt*(
conn: PgConnection,
sq: SqlQuery,
resultFormat: ResultFormat = rfAuto,
Expand Down Expand Up @@ -403,7 +403,7 @@ sqlQueryForwards:
timeout: Duration = ZeroDuration,
): untyped

proc queryOne*(
proc queryRowOpt*(
pool: PgPool,
sq: SqlQuery,
resultFormat: ResultFormat = rfAuto,
Expand Down Expand Up @@ -482,7 +482,7 @@ sqlQueryForwards:
timeout: Duration = ZeroDuration,
): untyped

proc readQueryOne*(
proc readQueryRowOpt*(
cluster: PgPoolCluster,
sq: SqlQuery,
resultFormat: ResultFormat = rfAuto,
Expand Down Expand Up @@ -563,7 +563,7 @@ sqlQueryForwards:
timeout: Duration = ZeroDuration,
): untyped

proc writeQueryOne*(
proc writeQueryRowOpt*(
cluster: PgPoolCluster,
sq: SqlQuery,
resultFormat: ResultFormat = rfAuto,
Expand Down
Loading
Loading