mirror of
https://github.com/Relintai/pandemonium_engine.git
synced 2025-01-26 10:59:18 +01:00
Added get_last_insert_rowid() method to PreparedStatement.
This commit is contained in:
parent
a52e1f168a
commit
c9ca35accd
@ -93,6 +93,8 @@ void PreparedStatement::_bind_methods() {
|
||||
|
||||
ClassDB::bind_method(D_METHOD("column_count"), &PreparedStatement::column_count);
|
||||
|
||||
ClassDB::bind_method(D_METHOD("get_last_insert_rowid"), &PreparedStatement::get_last_insert_rowid);
|
||||
|
||||
// Control
|
||||
|
||||
ClassDB::bind_method(D_METHOD("prepare"), &PreparedStatement::prepare);
|
||||
|
@ -100,6 +100,8 @@ public:
|
||||
|
||||
virtual int column_count() = 0;
|
||||
|
||||
virtual int get_last_insert_rowid() = 0;
|
||||
|
||||
// Control
|
||||
virtual Error prepare() = 0;
|
||||
virtual Error step() = 0;
|
||||
|
@ -41,6 +41,7 @@ class QueryResult : public Reference {
|
||||
|
||||
public:
|
||||
virtual bool next_row();
|
||||
|
||||
virtual String get_cell(const int index);
|
||||
virtual bool get_cell_bool(const int index);
|
||||
virtual int get_cell_int(const int index);
|
||||
|
@ -438,6 +438,12 @@ int SQLite3PreparedStatement::column_count() {
|
||||
return sqlite3_column_count(_prepared_statement);
|
||||
}
|
||||
|
||||
int SQLite3PreparedStatement::get_last_insert_rowid() {
|
||||
ERR_FAIL_COND_V(!_connection.is_valid(), 0);
|
||||
|
||||
return sqlite3_last_insert_rowid(_connection->conn);
|
||||
}
|
||||
|
||||
// Control
|
||||
Error SQLite3PreparedStatement::prepare() {
|
||||
ERR_FAIL_COND_V(!_connection.is_valid(), FAILED);
|
||||
|
@ -84,6 +84,8 @@ public:
|
||||
|
||||
virtual int column_count();
|
||||
|
||||
virtual int get_last_insert_rowid();
|
||||
|
||||
// Control
|
||||
virtual Error prepare();
|
||||
virtual Error step();
|
||||
|
Loading…
Reference in New Issue
Block a user