[libgda] Flatpak: Test application, adding statements



commit 2da89e7859f584ce6dcea72325410be6d68d9e4d
Author: Daniel Espinosa <esodan gmail com>
Date:   Sun Apr 14 14:25:04 2019 -0500

    Flatpak: Test application, adding statements

 tests/gda-test.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
---
diff --git a/tests/gda-test.c b/tests/gda-test.c
index 099bbf937..4a898caed 100644
--- a/tests/gda-test.c
+++ b/tests/gda-test.c
@@ -2,9 +2,19 @@
 
 int main() {
        GdaConnection *cnc;
+  GdaStatement *stmt;
+  GError *error = NULL;
        gda_init();
        cnc = gda_connection_open_from_string("SQLite", "DB_DIR=.;DB_NAME=test", NULL, 
GDA_CONNECTION_OPTIONS_NONE, NULL);
+  stmt = gda_connection_parse_sql_string (cnc, "CREATE TABLE t1(id INTEGER PRIMARY KEY, name text);", NULL, 
NULL);
+  gda_connection_statement_execute_non_select (cnc, stmt, NULL, NULL, NULL);
+  g_object_unref (stmt);
+  gda_connection_execute_non_select_command (cnc, "INSERT INTO t1 (name) VALUES ('t01')", error);
+  if (error != NULL) {
+    g_message ("Error messages: %s", error->message);
+  }
        g_object_unref(cnc);
+  g_message ("Exists without errors");
        return EXIT_SUCCESS;
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]