Skip to content

Commit

Permalink
Adding support for additional databases
Browse files Browse the repository at this point in the history
  • Loading branch information
Kenneth Shaw committed Jan 5, 2021
1 parent 652e0d5 commit 1d254e4
Show file tree
Hide file tree
Showing 5 changed files with 256 additions and 147 deletions.
162 changes: 93 additions & 69 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,40 +96,52 @@ The following are example database connection URLs that can be handled by
The following protocols schemes (ie, driver) and their associated aliases are
supported out of the box:

| Database (scheme/driver) | Protocol Aliases [real driver] |
|--------------------------------|------------------------------------------|
| Microsoft SQL Server (mssql) | ms, sqlserver |
| MySQL (mysql) | my, mariadb, maria, percona, aurora |
| Oracle Database (godror) | or, ora, oracle, oci, oci8, odpi, odpi-c |
| PostgreSQL (postgres) | pg, postgresql, pgsql |
| SQLite3 (sqlite3) | sq, sqlite, file |
| | |
| Amazon Redshift (redshift) | rs [postgres] |
| CockroachDB (cockroachdb) | cr, cockroach, crdb, cdb [postgres] |
| MemSQL (memsql) | me [mysql] |
| TiDB (tidb) | ti [mysql] |
| Vitess (vitess) | vt [mysql] |
| | |
| MySQL (mymysql) | zm, mymy |
| PostgreSQL (pgx) | px |
| | |
| Apache Avatica (avatica) | av, phoenix |
| Apache Ignite (ignite) | ig, gridgain |
| Cassandra (cql) | ca, cassandra, datastax, scy, scylla |
| ClickHouse (clickhouse) | ch |
| Couchbase (n1ql) | n1, couchbase |
| Cznic QL (ql) | ql, cznic, cznicql |
| Firebird SQL (firebirdsql) | fb, firebird |
| Microsoft ADODB (adodb) | ad, ado |
| ModernC SQLite (moderncsqlite) | mq, modernsqlite |
| ODBC (odbc) | od |
| OLE ODBC (oleodbc) | oo, ole, oleodbc [adodb] |
| Presto (presto) | pr, prestodb, prestos, prs, prestodbs |
| SAP ASE (tds) | ax, ase, sapase |
| SAP HANA (hdb) | sa, saphana, sap, hana |
| Snowflake (snowflake) | sf |
| Vertica (vertica) | ve |
| VoltDB (voltdb) | vo, volt, vdb |
<!-- START SCHEME TABLE -->
| Database (scheme/driver) | Protocol Aliases [real driver] |
|---------------------------------|------------------------------------------|
| Microsoft SQL Server (mssql) | ms, sqlserver |
| MySQL (mysql) | my, mariadb, maria, percona, aurora |
| Oracle Database (oracle) | or, ora, oracle, oci, oci8, odpi, odpi-c |
| PostgreSQL (postgres) | pg, postgresql, pgsql |
| SQLite3 (sqlite3) | sq, sqlite, file |
| | |
| Amazon Redshift (redshift) | rs [postgres] |
| CockroachDB (cockroachdb) | cr, cockroach, crdb, cdb [postgres] |
| MemSQL (memsql) | me [mysql] |
| TiDB (tidb) | ti [mysql] |
| Vitess (vitess) | vt [mysql] |
| | |
| MySQL (mymysql) | zm, mymy |
| Oracle Database (godror) | gr |
| PostgreSQL (pgx) | px |
| | |
| Alibaba MaxCompute (maxcompute) | mc |
| Apache Avatica (avatica) | av, phoenix |
| Apache H2 (h2) | h2 |
| Apache Hive (hive) | hi |
| Apache Ignite (ignite) | ig, gridgain |
| Apache Impala (impala) | im |
| AWS Athena (athena) | s3 |
| Azure Cosmos (cosmos) | cm |
| Cassandra (cql) | ca, cassandra, datastax, scy, scylla |
| ClickHouse (clickhouse) | ch |
| Couchbase (n1ql) | n1, couchbase |
| Cznic QL (ql) | ql, cznic, cznicql |
| Firebird SQL (firebirdsql) | fb, firebird |
| Genji (genji) | gj |
| Google BigQuery (bigquery) | bq |
| Google Spanner (spanner) | sp |
| Microsoft ADODB (adodb) | ad, ado |
| ModernC SQLite (moderncsqlite) | mq, modernsqlite |
| ODBC (odbc) | od |
| OLE ODBC (oleodbc) | oo, ole, oleodbc [adodb] |
| Presto (presto) | pr, prestodb, prestos, prs, prestodbs |
| SAP ASE (tds) | ax, ase, sapase |
| SAP HANA (hdb) | sa, saphana, sap, hana |
| Snowflake (snowflake) | sf |
| Vertica (vertica) | ve |
| VoltDB (voltdb) | vo, volt, vdb |
<!-- END SCHEME TABLE -->

Any protocol scheme `alias://` can be used in place of `protocol://`, and will
work identically with [`dburl.Parse`][godoc-parse] and [`dburl.Open`][godoc-open].
Expand All @@ -139,7 +151,7 @@ work identically with [`dburl.Parse`][godoc-parse] and [`dburl.Open`][godoc-open
Install in the usual Go fashion:

```sh
go get -u github.com/xo/dburl
$ go get -u github.com/xo/dburl
```

## Using
Expand All @@ -151,40 +163,52 @@ connection URLs.
For reference, these are the following "expected" SQL drivers that would need
to be imported:

| Database (driver) | Package |
|--------------------------------|---------------------------------------------------------------------------------------------|
| Microsoft SQL Server (mssql) | [github.com/denisenkom/go-mssqldb](https://github.com/denisenkom/go-mssqldb) |
| MySQL (mysql) | [github.com/go-sql-driver/mysql](https://github.com/go-sql-driver/mysql) |
| Oracle Database (godror) | [github.com/godror/godror](github.com/godror/godror) |
| PostgreSQL (postgres) | [github.com/lib/pq](https://github.com/lib/pq) |
| SQLite3 (sqlite3) | [github.com/mattn/go-sqlite3](https://github.com/mattn/go-sqlite3) |
| | |
| Amazon Redshift (redshift) | [github.com/lib/pq](https://github.com/lib/pq) |
| CockroachDB (cockroachdb) | [github.com/lib/pq](https://github.com/lib/pq) |
| MemSQL (memsql) | [github.com/go-sql-driver/mysql](https://github.com/go-sql-driver/mysql) |
| TiDB (tidb) | [github.com/go-sql-driver/mysql](https://github.com/go-sql-driver/mysql) |
| Vitess (vitess) | [github.com/go-sql-driver/mysql](https://github.com/go-sql-driver/mysql) |
| | |
| MySQL (mymysql) | [github.com/ziutek/mymysql/godrv](https://github.com/ziutek/mymysql) |
| PostgreSQL (pgx) | [github.com/jackc/pgx/stdlib](https://github.com/jackc/pgx) |
| | |
| Apache Avatica (avatica) | [github.com/Boostport/avatica](https://github.com/Boostport/avatica) |
| Apache Ignite (ignite) | [github.com/amsokol/ignite-go-client/sql](https://github.com/amsokol/ignite-go-client) |
| Cassandra (cql) | [github.com/MichaelS11/go-cql-driver](https://github.com/MichaelS11/go-cql-driver) |
| ClickHouse (clickhouse) | [github.com/ClickHouse/clickhouse-go](https://github.com/ClickHouse/clickhouse-go) |
| Couchbase (n1ql) | [github.com/couchbase/go_n1ql](https://github.com/couchbase/go_n1ql) |
| Cznic QL (ql) | [modernc.org/ql](https://modernc.org/ql) |
| Firebird SQL (firebirdsql) | [github.com/nakagami/firebirdsql](https://github.com/nakagami/firebirdsql) |
| Microsoft ADODB (adodb) | [github.com/mattn/go-adodb](https://github.com/mattn/go-adodb) |
| ModernC SQLite (moderncsqlite) | [modernc.org/sqlite](https://modernc.org/sqlite) |
| ODBC (odbc) | [github.com/alexbrainman/odbc](https://github.com/alexbrainman/odbc) |
| OLE ODBC (oleodbc) | [github.com/mattn/go-adodb](https://github.com/mattn/go-adodb) |
| Presto (presto) | [github.com/prestodb/presto-go-client/presto](https://github.com/prestodb/presto-go-client) |
| SAP ASE (tds) | [github.com/thda/tds](https://github.com/thda/tds) |
| SAP HANA (hdb) | [github.com/SAP/go-hdb/driver](https://github.com/SAP/go-hdb) |
| Snowflake (snowflake) | [github.com/snowflakedb/gosnowflake](https://github.com/snowflakedb/gosnowflake) |
| Vertica (vertica) | [github.com/vertica/vertica-sql-go](https://github.com/vertica/vertica-sql-go) |
| VoltDB (voltdb) | [github.com/VoltDB/voltdb-client-go/voltdbclient](github.com/VoltDB/voltdb-client-go]) |
<!-- START DRIVER TABLE -->
| Database (driver) | Package |
|---------------------------------|---------------------------------------------------------------------------------------------|
| Microsoft SQL Server (mssql) | [github.com/denisenkom/go-mssqldb](https://github.com/denisenkom/go-mssqldb) |
| MySQL (mysql) | [github.com/go-sql-driver/mysql](https://github.com/go-sql-driver/mysql) |
| Oracle Database (oracle) | [github.com/sijms/go-ora](https://github.com/sijms/go-ora) |
| PostgreSQL (postgres) | [github.com/lib/pq](https://github.com/lib/pq) |
| SQLite3 (sqlite3) | [github.com/mattn/go-sqlite3](https://github.com/mattn/go-sqlite3) |
| | |
| Amazon Redshift (redshift) | [github.com/lib/pq](https://github.com/lib/pq) |
| CockroachDB (cockroachdb) | [github.com/lib/pq](https://github.com/lib/pq) |
| MemSQL (memsql) | [github.com/go-sql-driver/mysql](https://github.com/go-sql-driver/mysql) |
| TiDB (tidb) | [github.com/go-sql-driver/mysql](https://github.com/go-sql-driver/mysql) |
| Vitess (vitess) | [github.com/go-sql-driver/mysql](https://github.com/go-sql-driver/mysql) |
| | |
| MySQL (mymysql) | [github.com/ziutek/mymysql/godrv](https://github.com/ziutek/mymysql) |
| Oracle Database (godror) | [github.com/godror/godror](github.com/godror/godror) |
| PostgreSQL (pgx) | [github.com/jackc/pgx/stdlib](https://github.com/jackc/pgx) |
| | |
| Alibaba MaxCompute (maxcompute) | [sqlflow.org/gomaxcompute](https://sqlflow.org/gomaxcompute) |
| Apache Avatica (avatica) | [github.com/Boostport/avatica](https://github.com/Boostport/avatica) |
| Apache H2 (h2) | [github.com/jmrobles/h2go](https://github.com/jmrobles/h2go) |
| Apache Hive (hive) | [sqlflow.org/gohive](https://sqlflow.org/gohive) |
| Apache Ignite (ignite) | [github.com/amsokol/ignite-go-client/sql](https://github.com/amsokol/ignite-go-client) |
| Apache Impala (impala) | [github.com/bippio/go-impala](https://github.com/bippio/go-impala) |
| AWS Athena (athena) | [github.com/uber/athenadriver/go](https://github.com/uber/athenadriver) |
| Azure Cosmos (cosmos) | [github.com/btnguyen2k/gocosmos](https://github.com/btnguyen2k/gocosmos) |
| Cassandra (cql) | [github.com/MichaelS11/go-cql-driver](https://github.com/MichaelS11/go-cql-driver) |
| ClickHouse (clickhouse) | [github.com/ClickHouse/clickhouse-go](https://github.com/ClickHouse/clickhouse-go) |
| Couchbase (n1ql) | [github.com/couchbase/go_n1ql](https://github.com/couchbase/go_n1ql) |
| Cznic QL (ql) | [modernc.org/ql](https://modernc.org/ql) |
| Firebird SQL (firebirdsql) | [github.com/nakagami/firebirdsql](https://github.com/nakagami/firebirdsql) |
| Genji (genji) | [github.com/genjidb/genji/sql/driver](https://github.com/genjidb/genji) |
| Google BigQuery (bigquery) | [gorm.io/driver/bigquery/driver](https://gorm.io/driver/bigquery/driver) |
| Google Spanner (spanner) | [github.com/rakyll/go-sql-driver-spanner](https://github.com/rakyll/go-sql-driver-spanner) |
| Microsoft ADODB (adodb) | [github.com/mattn/go-adodb](https://github.com/mattn/go-adodb) |
| ModernC SQLite (moderncsqlite) | [modernc.org/sqlite](https://modernc.org/sqlite) |
| ODBC (odbc) | [github.com/alexbrainman/odbc](https://github.com/alexbrainman/odbc) |
| OLE ODBC (oleodbc) | [github.com/mattn/go-adodb](https://github.com/mattn/go-adodb) |
| Presto (presto) | [github.com/prestodb/presto-go-client/presto](https://github.com/prestodb/presto-go-client) |
| SAP ASE (tds) | [github.com/thda/tds](https://github.com/thda/tds) |
| SAP HANA (hdb) | [github.com/SAP/go-hdb/driver](https://github.com/SAP/go-hdb) |
| Snowflake (snowflake) | [github.com/snowflakedb/gosnowflake](https://github.com/snowflakedb/gosnowflake) |
| Vertica (vertica) | [github.com/vertica/vertica-sql-go](https://github.com/vertica/vertica-sql-go) |
| VoltDB (voltdb) | [github.com/VoltDB/voltdb-client-go/voltdbclient](github.com/VoltDB/voltdb-client-go]) |
<!-- END DRIVER TABLE -->

Please see [the `dburl` GoDoc listing][godoc-link] for the full API
documentation.
Expand Down
Loading

0 comments on commit 1d254e4

Please sign in to comment.