[libgda: 1/2] PostgreSQL improvements



commit 36254948c1228a7badef0112f0d96be3f0d7cd14
Author: Pavlo Solntsev <p sun fun gmail com>
Date:   Thu Dec 13 23:29:02 2018 +0000

    PostgreSQL improvements

 .gitlab-ci.yml                        | 14 +++++++++++++-
 providers/postgres/gda-postgres-ddl.c | 12 +++++-------
 2 files changed, 18 insertions(+), 8 deletions(-)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index b0cea0cab..3fc496030 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -4,6 +4,9 @@
 # see https://hub.docker.com/_/gcc/
 image: ubuntu:devel
 
+services:
+        - postgres:latest
+
 stages:
      - build
 
@@ -31,9 +34,18 @@ variables:
                 libgee-0.8-dev
                 valadoc
                 libgladeui-dev
+                postgresql-client
+                postgresql-client-common
 
   GIT_SUBMODULE_STRATEGY: normal
-
+  GDA_PSQ_HOST: postgres
+  GDA_PSQ_PASSWORD: "postgres"
+  GDA_PSQ_USER: postgres 
+  SQLITE_DBCREATE_PARAMS: "DB_DIR=."
+  SQLITE_CNC_PARAMS: "DB_DIR=."
+  POSTGRESQL_DBCREATE_PARAMS: 
"HOST=$GDA_PSQ_HOST;PORT=5432;ADM_LOGIN=$GDA_PSQ_USER;ADM_PASSWORD='$GDA_PSQ_PASSWORD'"
+  POSTGRESQL_CNC_PARAMS: "HOST=$GDA_PSQ_HOST;PORT=5432;USERNAME=$GDA_PSQ_USER;PASSWORD='$GDA_PSQ_PASSWORD'"
+  
 before_script:
   - apt update && apt -y install $DEPENDENCIES
 
diff --git a/providers/postgres/gda-postgres-ddl.c b/providers/postgres/gda-postgres-ddl.c
index 2ecdf55e1..2307ac763 100644
--- a/providers/postgres/gda-postgres-ddl.c
+++ b/providers/postgres/gda-postgres-ddl.c
@@ -36,14 +36,12 @@ gda_postgres_render_CREATE_DB (GdaServerProvider *provider, GdaConnection *cnc,
 
        string = g_string_new ("CREATE DATABASE ");
 
-       tmp = gda_connection_operation_get_sql_identifier_at (cnc, op, "/DB_DEF_P/DB_NAME", error);
-       if (!tmp) {
-               g_string_free (string, TRUE);
-               return NULL;
-       }
+       value = gda_server_operation_get_value_at (op, "/DB_DEF_P/DB_NAME");
+  if (!value)
+    return NULL;
 
-       g_string_append (string, tmp);
-       g_free (tmp);
+       if (value && G_VALUE_HOLDS (value, G_TYPE_STRING) && g_value_get_string (value)) 
+               g_string_append (string, g_value_get_string (value));
 
        value = gda_server_operation_get_value_at (op, "/DB_DEF_P/OWNER");
        if (value && G_VALUE_HOLDS (value, G_TYPE_STRING) && g_value_get_string (value)) {


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