-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Request to support create/drop a database. #45
Comments
Hi @tredoe If go add's support for creating a database. we will also support that. Thanks, |
I can create databases using the package database/sql at other DBMSs like Mysql, PostgreSQL, MariaDB, and Microsoft SQL Server (it's that I've tested until now). By now, only fails with IBM DB2. The next ones to testing are Oracle and Firebird. So it is not an issue related to the support at database/sql. To create a database, there is to connect to the master database and then to send a statement like 'CREATE DATABASE [name]'. |
Can you send me the GitHub links of these drivers? |
MySQL/MariaDB: "github.com/go-sql-driver/mysql" In fact, I could add the code where it shows how I create a database. MySQL or PostgreSQL? |
Hi @tredoe And in the go-driver, we can add that support if you are not connecting to the database. Thanks, |
@tredoe we cannot add a create database with db.Exec() but we can try to add this support with a new api.
|
It is not necessary to add a new API. If the connection string has the key 'Database', then it connect to such DB, else it connects to the instance where we could send a statement like "CREATE DATABASE". |
@tredoe |
I'm talking about IBM DB2, and I used the string "Hostname=127.0.0.1;Protocol=tcpip;Port=50000;Database=%s;Uid=%s;Pwd=%s". It was only an idea to not have to add a different API. |
Our clidriver does not work in that way...It uses different api to create a database. Create database is admin operation. |
With Oracle there is also to use a command to create a database (sqlplus; db2 for IBM2), so there is no need to change the API on this driver. Those DBMSs work of that way and there is no need to change the API to be enable to create/drop a database. Thanks anyway! |
Hi @tredoe I don't know how oracle handles 'create database' query but in our db2 you have to call a new api to create the database, not the exec api. You can check this documentation where we support create and drop database API's. we have taken your request to support create and drop database api but it will be supported in the same way how node js supports. Thanks, |
Hi @tredoe Database creation support has been added. Please pull the latest code and use it. Thanks, |
Please, could you to add support to create and drop a database with db.Exec() API?
Thanks in advance!
The text was updated successfully, but these errors were encountered: