On 11/18/06, Murray Cumming <[EMAIL PROTECTED]> wrote: > On Wed, 2006-11-15 at 16:15 +0100, Vivien Malerba wrote: > > > > > Surely, we _always_ need the database name, whatever provider we > > are > > > > > using. So that can be a parameter to prepare_create_database()? > > > > > > > > > > I'm also surprised that both prepare_create_database() and > > > > > perform_create_database() take the provider name. Surely that > > should > > > > be > > > > > decided since calling prepare_create_database(). > > > > > > > > Yes, this can easily be done. > > > > > > Will you have a chance to do this? > > > > Done it locally, I'll try to take some time to commit that tonight. > > Thanks. Although the provider name must not now be provided twice, I > still hope that prepare_create_database() could take the new database > name explicitly as a parameter.
The name of the database to create, even if it's mandatory is just a named parameter among th other required parameters, so even if it was passed as a function argument, you'd still have to set the other names parameters "manually". > > Also, it would be nice if the documentation for these methods stated > whether it is necessary to first open a connection. I don't see how it > could create a database without knowing the other connection details, > such as hostname. As far as I know, no opened connection is ever required to perform a create db or drop db. When applicable (that is when there is a distant server) the information to connect to the server are among the required named parameters in the GdaServerOperation object. For example here are the named parameter for the create DB on a MySQL provider (as printed by the gnome-db-demo program): * /SERVER_CNX_P (GdaParameterList @0x8287590) * /SERVER_CNX_P/HOST (GdaParameter) = NULL * /SERVER_CNX_P/PORT (GdaParameter) = NULL * /SERVER_CNX_P/UNIX_SOCKET (GdaParameter) = NULL * /SERVER_CNX_P/ADM_LOGIN (GdaParameter) = NULL * /SERVER_CNX_P/ADM_PASSWORD (GdaParameter) = NULL * /SERVER_CNX_P/USE_SSL (GdaParameter) = NULL * /DB_DEF_P (GdaParameterList @0x83d8028) * /DB_DEF_P/DB_NAME (GdaParameter) = NULL * /DB_DEF_P/DB_IFNOTEXISTS (GdaParameter) = NULL * /DB_DEF_P/DB_CSET (GdaParameter) = NULL * /DB_DEF_P/DB_COLLATION (GdaParameter) = NULL and for the PostgreSQL one: * /SERVER_CNX_P (GdaParameterList @0x83d8028) * /SERVER_CNX_P/HOST (GdaParameter) = NULL * /SERVER_CNX_P/PORT (GdaParameter) = NULL * /SERVER_CNX_P/OPTIONS (GdaParameter) = NULL * /SERVER_CNX_P/ADM_LOGIN (GdaParameter) = NULL * /SERVER_CNX_P/ADM_PASSWORD (GdaParameter) = NULL * /SERVER_CNX_P/USE_SSL (GdaParameter) = NULL * /DB_DEF_P (GdaParameterList @0x83d82f0) * /DB_DEF_P/DB_NAME (GdaParameter) = NULL * /DB_DEF_P/DB_CSET (GdaParameter) = NULL * /DB_DEF_P/DB_OWNER (GdaParameter) = NULL * /DB_DEF_P/TEMPLATE (GdaParameter) = NULL * /DB_DEF_P/DB_TABLESPACE (GdaParameter) = NULL and for SQLite (which does not have a distant server): * /DB_DEF_P (GdaParameterList @0x80d5f90) * /DB_DEF_P/DB_NAME (GdaParameter) = NULL * /DB_DEF_P/DB_DIR (GdaParameter) = NULL Note some common named parameters (and maybe they should be included in the doc). Cheers, Vivien _______________________________________________ gnome-db-list mailing list gnome-db-list@gnome.org http://mail.gnome.org/mailman/listinfo/gnome-db-list