Re: [gnome-db] Create SQLite db



Dear Corentin.

Thank you for info. It is interesting. It looks like the DB file should be created before calling gda_server_operation_create_database(). I am exploring his approach. Thanks.


-Pavlo Solntsev
---------------------------------------------------------------------------------------------
Please avoid sending me Word or PowerPoint attachments.
See http://www.gnu.org/philosophy/no-word-attachments.html


On Tue, Sep 12, 2017 at 7:46 AM, Corentin Noël <corentin elementary io> wrote:
Hi Pavlo,
In elementary's music application, we are using gda_connection_new_from_string
https://github.com/elementary/music/blob/master/src/LocalBackend/LocalLibrary.vala#L140
You also have a few examples in the source tree https://github.com/GNOME/libgda/tree/master/examples

Regards,
Corentin Noël, elementary developer

2017-09-11 21:04 GMT+02:00 Pavlo Solntsev <pavlo solntsev gmail com>:
Hi,
I am trying to create SQLIte DB. I used gda_server_operation_prepare_create_database
                               (const gchar *provider,
                                const gchar *db_name,
                                GError **error); 
to obtain a GdaServerOperation object. provider = "SQLite"

 The returned pointer was checked for NULL.

Then, I used gda_server_operation_perform_create_database to create DB. This function returns TRUE but I don't DB file. I was thinking, maybe format of db_name may somehow affect this? For now, I used the full path in UNIX notation with .db suffix, just a DB name with .db suffix. In all  cases function returns TRUE but I don't see any DB file. Could you please clarify what would be correct use of GdaServerOperation functions to create DB? Thanks.



-Pavlo Solntsev
---------------------------------------------------------------------------------------------
Please avoid sending me Word or PowerPoint attachments.
See http://www.gnu.org/philosophy/no-word-attachments.html


_______________________________________________
gnome-db-list mailing list
gnome-db-list gnome org
https://mail.gnome.org/mailman/listinfo/gnome-db-list





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