Comments (13)
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.
https://github.com/ibmdb/node-ibm_db/blob/master/APIDocumentation.md#createDbSyncApi
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,
Akhil
from go_ibm_db.
Hi @tredoe
Our driver is based on the go standard package database/sql.
As of now, database package does not support create a database (admin operation) so we cannot support it.
If go add's support for creating a database. we will also support that.
Thanks,
Akhil.
from go_ibm_db.
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]'.
from go_ibm_db.
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)
Can you send me the GitHub links of these drivers?
from go_ibm_db.
MySQL/MariaDB: "github.com/go-sql-driver/mysql"
PostgreSQL: "github.com/lib/pq"
SQL Server: "github.com/denisenkom/go-mssqldb"
In fact, I could add the code where it shows how I create a database. MySQL or PostgreSQL?
from go_ibm_db.
Hi @tredoe
In IBM db2 to create a database, you have to disconnect from the database.
And in the go-driver, we can add that support if you are not connecting to the database.
Thanks,
Akhil
from go_ibm_db.
could you to add support to create and drop a database with db.Exec() API?
@tredoe we cannot add a create database with db.Exec() but we can try to add this support with a new api.
Sample:-
import 'github.com/ibmdb/go_ibm_db'
func main(){
//connection string without database name.
go_ibm_db.CreateDB('databasename', 'host=localhost;uid=uname;pass=password,port=40000')
}
from go_ibm_db.
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".
from go_ibm_db.
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
Are you talking about IBM DB?
Did you pass the connection string(like datbase, host, uid, port, pass) or dsn=name?
from go_ibm_db.
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.
from go_ibm_db.
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.
from go_ibm_db.
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!
from go_ibm_db.
Hi @tredoe
Database creation support has been added. Please pull the latest code and use it.
Thanks,
Akhil
from go_ibm_db.
Related Issues (20)
- Not able to connect to a new DB2 instance as soon as previous connection is closed HOT 6
- Context with timeout will not prevent long running queries HOT 3
- `ExecContext` and `QueryContext` do not implement any `database/sql` interfaces HOT 1
- Installer setup program fails. HOT 2
- Link Error `libdb2.so: undefined reference to sqloRemStgDelete` HOT 6
- Unable to run [email protected] on M1 architecture HOT 14
- error while loading shared libraries: libcrypt.so.1 HOT 3
- ibmdb/go_ibm_db pooling vs database/sql pooling HOT 6
- Panic when initDriver HOT 6
- index out of range [2021] with length 2021 HOT 3
- ../../go/pkg/mod/github.com/ibmdb/[email protected]/api/api_unix.go:13:11: fatal error: sqlcli1.h: No such file or directory HOT 2
- How to fix CLI0129E An attempt to allocate a handle failed because there are no more handles to allocate HOT 2
- After connecting to db2 successfully, Chinese character display exception in the query result HOT 14
- Stored procedures support array-based input parameters HOT 2
- Inconsistent GSKIT Error 2 HOT 12
- fatal error: invalid pointer found on stack HOT 6
- [help]how to debug the cost breakdown HOT 2
- The gbk encoded Chinese field may be truncated when read in the utf8 operating environment HOT 1
- SQL_DECIMAL type uses comma as separator, not period, so it can't convert to float64 HOT 5
- [CRITICAL] - double byte characters are truncated for CHAR columns HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go_ibm_db.