From b14a32e61749127964e0ec5b2aaae2887fa27b9e Mon Sep 17 00:00:00 2001 From: Kenneth Shaw Date: Sat, 6 Jan 2024 17:03:51 +0700 Subject: [PATCH] Adding ramsql --- README.md | 2 ++ drivers/ramsql/ramsql.go | 13 +++++++++++++ go.mod | 3 ++- go.sum | 14 ++++++++++++-- internal/internal.go | 1 + internal/ramsql.go | 9 +++++++++ 6 files changed, 39 insertions(+), 3 deletions(-) create mode 100644 drivers/ramsql/ramsql.go create mode 100644 internal/ramsql.go diff --git a/README.md b/README.md index a0df73a1e64..e2e3b8e21cd 100644 --- a/README.md +++ b/README.md @@ -251,6 +251,7 @@ associated database, scheme / build tag, and scheme aliases: | Netezza | `netezza` | `nz`, `nzgo` | [github.com/IBM/nzgo/v12][d-netezza] | | PostgreSQL PGX | `pgx` | `px` | [github.com/jackc/pgx/v5/stdlib][d-pgx] | | Presto | `presto` | `pr`, `prs`, `prestos`, `prestodb`, `prestodbs` | [github.com/prestodb/presto-go-client/presto][d-presto] | +| RamSQL | `ramsql` | `rm`, `ram` | [github.com/proullon/ramsql/driver][d-ramsql] | | SAP ASE | `sapase` | `ax`, `ase`, `tds` | [github.com/thda/tds][d-sapase] | | SAP HANA | `saphana` | `sa`, `sap`, `hana`, `hdb` | [github.com/SAP/go-hdb/driver][d-saphana] | | Snowflake | `snowflake` | `sf` | [github.com/snowflakedb/gosnowflake][d-snowflake] | @@ -311,6 +312,7 @@ associated database, scheme / build tag, and scheme aliases: [d-postgres]: https://github.com/lib/pq [d-presto]: https://github.com/prestodb/presto-go-client [d-ql]: https://gitlab.com/cznic/ql +[d-ramsql]: https://github.com/proullon/ramsql [d-sapase]: https://github.com/thda/tds [d-saphana]: https://github.com/SAP/go-hdb [d-snowflake]: https://github.com/snowflakedb/gosnowflake diff --git a/drivers/ramsql/ramsql.go b/drivers/ramsql/ramsql.go new file mode 100644 index 00000000000..a34d816eca8 --- /dev/null +++ b/drivers/ramsql/ramsql.go @@ -0,0 +1,13 @@ +// Package ramsql defines and registers usql's RamSQL driver. +// +// See: https://github.com/proullon/ramsql +package ql + +import ( + _ "github.com/proullon/ramsql/driver" // DRIVER + "github.com/xo/usql/drivers" +) + +func init() { + drivers.Register("ramsql", drivers.Driver{}) +} diff --git a/go.mod b/go.mod index ebf01b39443..8b66610f084 100644 --- a/go.mod +++ b/go.mod @@ -46,13 +46,14 @@ require ( github.com/nakagami/firebirdsql v0.9.6 github.com/ory/dockertest/v3 v3.10.0 github.com/prestodb/presto-go-client v0.0.0-20230524183650-a1a0bac0f63e + github.com/proullon/ramsql v0.1.3 github.com/sijms/go-ora/v2 v2.8.5 github.com/snowflakedb/gosnowflake v1.7.1 github.com/thda/tds v0.1.7 github.com/trinodb/trino-go-client v0.313.0 github.com/uber/athenadriver v1.1.14 github.com/vertica/vertica-sql-go v1.3.3 - github.com/xo/dburl v0.20.1 + github.com/xo/dburl v0.20.2 github.com/xo/tblfmt v0.10.3 github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e github.com/ydb-platform/ydb-go-sdk/v3 v3.54.3 diff --git a/go.sum b/go.sum index a03d9d4c226..530e6636286 100644 --- a/go.sum +++ b/go.sum @@ -528,6 +528,8 @@ github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9 github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200625191551-73d3c3675aa3/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-gorp/gorp v2.2.0+incompatible h1:xAUh4QgEeqPPhK3vxZN+bzrim1z5Av6q837gtjUlshc= +github.com/go-gorp/gorp v2.2.0+incompatible/go.mod h1:7IfkAQnO7jfT/9IQ3R9wL1dFhukN6aQxzKTHnkxzA/E= github.com/go-jose/go-jose/v3 v3.0.1 h1:pWmKFVtt+Jl0vBZTIpz/eAKwsm6LkIxDVVbFHKkchhA= github.com/go-jose/go-jose/v3 v3.0.1/go.mod h1:RNkWWRld676jZEYoV3+XK8L2ZnNSvIsxFMht0mSX+u8= github.com/go-logfmt/logfmt v0.6.0 h1:wGYYu3uicYdqXVgoYbvnkrPVXkuLM1p1ifugDMEdRi4= @@ -792,8 +794,10 @@ github.com/jedib0t/go-pretty/v6 v6.2.7/go.mod h1:FMkOpgGD3EZ91cW8g/96RfxoV7bdeJy github.com/jedib0t/go-pretty/v6 v6.4.9 h1:vZ6bjGg2eBSrJn365qlxGcaWu09Id+LHtrfDWlB2Usc= github.com/jedib0t/go-pretty/v6 v6.4.9/go.mod h1:Ndk3ase2CkQbXLLNf5QDHoYb6J9WtVfmHZu9n8rk2xs= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= +github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E= github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= github.com/jinzhu/now v1.1.4/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= +github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ= github.com/jinzhu/now v1.1.5/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= @@ -953,6 +957,8 @@ github.com/prometheus/common v0.45.0/go.mod h1:YJmSTw9BoKxJplESWWxlbyttQR4uaEcGy github.com/prometheus/procfs v0.0.0-20190425082905-87a4384529e0/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= +github.com/proullon/ramsql v0.1.3 h1:/LRcXJf4lEmhdb4tYcci473I2VynjcZSzh2hsjJ8rSk= +github.com/proullon/ramsql v0.1.3/go.mod h1:CFGqeQHQpdRfWqYmWD3yXqPTEaHkF4zgXy1C6qDWc9E= github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE= github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= @@ -1051,8 +1057,8 @@ github.com/xeipuuv/gojsonschema v1.2.0 h1:LhYJRs+L4fBtjZUfuSZIKGeVu0QRy8e5Xi7D17 github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= github.com/xhit/go-str2duration/v2 v2.1.0 h1:lxklc02Drh6ynqX+DdPyp5pCKLUQpRT8bp8Ydu2Bstc= github.com/xhit/go-str2duration/v2 v2.1.0/go.mod h1:ohY8p+0f07DiV6Em5LKB0s2YpLtXVyJfNt1+BlmyAsU= -github.com/xo/dburl v0.20.1 h1:YEhpSpMmIDvzH0ACoFJ5mVYBQ7701TRx9rsknyal1Nk= -github.com/xo/dburl v0.20.1/go.mod h1:B7/G9FGungw6ighV8xJNwWYQPMfn3gsi2sn5SE8Bzco= +github.com/xo/dburl v0.20.2 h1:59zqIzahtfQ/X9E6fyp1ziHwjYEFy65opjpyQPmZC7w= +github.com/xo/dburl v0.20.2/go.mod h1:B7/G9FGungw6ighV8xJNwWYQPMfn3gsi2sn5SE8Bzco= github.com/xo/tblfmt v0.0.0-20190609041254-28c54ec42ce8/go.mod h1:3U5kKQdIhwACye7ml3acccHmjGExY9WmUGU7rnDWgv0= github.com/xo/tblfmt v0.10.3 h1:Fb2Le5wvzBjOwA/KFRpP5bZo+iR9cZnzSAN3tULoUPI= github.com/xo/tblfmt v0.10.3/go.mod h1:W6oqhxtqDOEMkrS2GPO0zmcww7ozM2E6BRv3kNfXd24= @@ -1762,7 +1768,11 @@ gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gorm.io/driver/bigquery v1.2.0 h1:E94oEXErYb4uImcR8oiCjE1SP2VdnrL5f3d78PtFWNk= gorm.io/driver/bigquery v1.2.0/go.mod h1:/5kcyb6RVIk/seff6YANAjB5aisE4oqY35x0Ix9iwXY= +gorm.io/driver/postgres v1.5.2 h1:ytTDxxEv+MplXOfFe3Lzm7SjG09fcdb3Z/c056DTBx0= +gorm.io/driver/postgres v1.5.2/go.mod h1:fmpX0m2I1PKuR7mKZiEluwrP3hbs+ps7JIGMUBpCgl8= gorm.io/gorm v1.24.0/go.mod h1:DVrVomtaYTbqs7gB/x2uVvqnXzv0nqjB396B8cG4dBA= +gorm.io/gorm v1.25.2 h1:gs1o6Vsa+oVKG/a9ElL3XgyGfghFfkKA2SInQaCyMho= +gorm.io/gorm v1.25.2/go.mod h1:L4uxeKpfBml98NYqVqwAdmV1a2nBtAec/cf3fpucW/k= gotest.tools/gotestsum v1.11.0 h1:A88/QWw7acMjZH1dMe6KZFhw32odUOIjCiAU/Q4n3mI= gotest.tools/gotestsum v1.11.0/go.mod h1:cUOKgFEvWAP0twchmiOvdzX0SBZX0UI58bGRpRIu4xs= gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= diff --git a/internal/internal.go b/internal/internal.go index db3cfc9aef6..e73096bd575 100644 --- a/internal/internal.go +++ b/internal/internal.go @@ -42,6 +42,7 @@ func KnownBuildTags() map[string]string { "postgres": "postgres", // github.com/lib/pq "presto": "presto", // github.com/prestodb/presto-go-client/presto "ql": "ql", // modernc.org/ql + "ramsql": "ramsql", // github.com/proullon/ramsql/driver "sapase": "tds", // github.com/thda/tds "saphana": "hdb", // github.com/SAP/go-hdb/driver "snowflake": "snowflake", // github.com/snowflakedb/gosnowflake diff --git a/internal/ramsql.go b/internal/ramsql.go new file mode 100644 index 00000000000..0039a521a14 --- /dev/null +++ b/internal/ramsql.go @@ -0,0 +1,9 @@ +//go:build (all || most || ramsql) && !no_ramsql + +package internal + +// Code generated by gen.go. DO NOT EDIT. + +import ( + _ "github.com/xo/usql/drivers/ramsql" // RamSQL driver +)