[vala] sqlite3: Allow some values to be nullable
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala] sqlite3: Allow some values to be nullable
- Date: Mon, 12 Sep 2016 10:24:46 +0000 (UTC)
commit ab1d119793db2b78a00b44d4de3d3902c0e98eab
Author: Ernestas Kulik <ernestas kulik gmail com>
Date: Sun Oct 11 12:30:24 2015 +0300
sqlite3: Allow some values to be nullable
This fixes Database.get_table() as it throws an error when compiling in
strict non-null mode and also features tweaks in Database.{_,}exec and
Statement.column_text signatures to accomodate potential null returns.
https://bugzilla.gnome.org/show_bug.cgi?id=754238
vapi/sqlite3.vapi | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/vapi/sqlite3.vapi b/vapi/sqlite3.vapi
index d2eb037..cd331df 100644
--- a/vapi/sqlite3.vapi
+++ b/vapi/sqlite3.vapi
@@ -29,10 +29,10 @@ namespace Sqlite {
public int busy_timeout (int ms);
public int changes ();
[CCode (cname = "sqlite3_exec")]
- public int _exec (string sql, Callback? callback = null, [CCode (type = "char**")] out
unowned string errmsg = null);
+ public int _exec (string sql, Callback? callback = null, [CCode (type = "char**")] out
unowned string? errmsg = null);
[CCode (cname = "_sqlite3_exec")]
- public int exec (string sql, Callback? callback = null, out string errmsg = null) {
- unowned string sqlite_errmsg;
+ public int exec (string sql, Callback? callback = null, out string? errmsg = null) {
+ unowned string? sqlite_errmsg;
var ec = this._exec (sql, callback, out sqlite_errmsg);
if (&errmsg != null) {
errmsg = sqlite_errmsg;
@@ -52,7 +52,7 @@ namespace Sqlite {
private static void free_table ([CCode (array_length = false)] string[] result);
[CCode (cname = "_sqlite3_get_table")]
public int get_table (string sql, out string[] resultp, out int nrow, out int ncolumn, out
string? errmsg = null) {
- unowned string sqlite_errmsg;
+ unowned string? sqlite_errmsg;
unowned string[] sqlite_resultp;
var ec = this._get_table (sql, out sqlite_resultp, out nrow, out ncolumn, out
sqlite_errmsg);
@@ -376,7 +376,7 @@ namespace Sqlite {
public double column_double (int col);
public int column_int (int col);
public int64 column_int64 (int col);
- public unowned string column_text (int col);
+ public unowned string? column_text (int col);
public int column_type (int col);
public unowned Value column_value (int col);
public unowned string column_name (int index);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]