Skip to content

Commit

Permalink
[db] added new DB_CAP_PREPARED_STMT capability
Browse files Browse the repository at this point in the history
to identify the db backends able to provide prepared statements.
DB_MYSQL is for now the only condidate
  • Loading branch information
bogdan-iancu committed Apr 18, 2024
1 parent 183b41d commit 6b2dbbc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions db/db_cap.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ typedef enum db_cap {
DB_CAP_LAST_INSERTED_ID = 1 << 8, /**< driver can return the ID of the last insert operation */
DB_CAP_INSERT_UPDATE = 1 << 9, /**< driver can insert data into database and update on duplicate */
DB_CAP_MULTIPLE_INSERT = 1 << 10, /**< driver can insert multiple rows at once */
DB_CAP_PREPARED_STMT = 1 << 11, /**< driver supports prep statements */
} db_cap_t;


Expand Down
2 changes: 1 addition & 1 deletion modules/db_mysql/db_mysql.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ int db_mysql_bind_api(const str* mod, db_func_t *dbb)
dbb->async_free_result = db_mysql_async_free_result;
dbb->async_timeout = db_mysql_async_timeout;

dbb->cap |= DB_CAP_MULTIPLE_INSERT;
dbb->cap |= DB_CAP_MULTIPLE_INSERT|DB_CAP_PREPARED_STMT;
return 0;
}

0 comments on commit 6b2dbbc

Please sign in to comment.