4 ms·
Just released the latest version of usql, which fixes issues with syntax highlighting, adds initial support for Cassandra databases via CQL, among other changes
by kenshaw 8y ago
Just released the latest version of usql, which fixes issues with syntax highlighting, adds initial support for Cassandra databases via CQL, among other changes.
If you've not seen usql before, it's a universal command-line client for SQL databases (and now also Cassandra), modeled on psql. usql makes it easy to work from the command-line, in a simple and consistent way across any database and on any platform (Windows, macOS, Linux). usql is written in Go, and provides things like syntax highlighting and compatibility with databases other than PostgreSQL (see below for the list of the supported databases).
Progress is moving at a decent clip towards a v1.0, which I expect to include 100% native Go support for Oracle databases, tab-completion, full compatibility with psql's \pset (and other output formatting) commands.
usql supports the following databases:
Microsoft SQL Server
MySQL
PostgreSQL
SQLite3
Oracle
Apache Avatica
Cassandra
ClickHouse
Couchbase
Cznic QL
Firebird SQL
Microsoft ADODB (Windows only)
ODBC
Presto
SAP HANA
VoltDB
Hope others in the community can make use of usql. Glad to answer any questions if anyone has any.
- bruce_one 8y ago100% native Go support for Oracle sounds amazing (I'm reading that as meaning no instantclient sdk requirement, just to confirm (which might be wrong...)). Is there an issue/pr/library for that work? It will very much enter the toolbox for all situations if that can happen :-) (Looking for something better than sqlplus is always why I end up looking into usql...) usql is super cool, thank you for all the work you've done with it :-)
- kenshaw 8y agoYes, I've been working on a 100% native Go driver for Oracle. It is not even alpha or beta quality at this time.
- grumpydba 8y agoHi, can I see the code, and can I help? I have a beta SAP ASE driver that should come out soon, BTW.
- kenshaw 8y agoIt's more of a passionate side project at the moment, as I am still reverse engineering the protocols involved. It's not close to completion, but I'm hoping to have it done sometime in the next few months. It's not a high priority, as there are other ways to connect to Oracle. My goal is to get rid of all the non-Go dependencies, which would (for the first time, ever) finally make it a reality to have a single, small binary that can connect to "every" database and that can be freely distributed. If you'd like to help, please feel free to start an implementation. While I'm not following a specific development routine for the native Oracle driver, I do have a repository with a bunch of (non-building) code that I made to assist with inspecting the raw protocol captures.
- grumpydba 8y agoSomeone has already been there, the protocol is very.. rich, I would say: https://blog.pythian.com/repost-oracle-protocol/ https://blog.pythian.com/repost-oracle-protocol/
- tracker1 8y agoHell, if that lead to Oracle drivers for other languages, that could be amazing too. It's nearly incomprehensible to me why Oracle hasn't documented their protocol.
- emmelaich 8y agoThen it would difficult to change. For instance to support clusters and failover.
- grumpydba 8y agoMSSQL server protocol is documented and failover is handled. Protocol are usually versioned, or the initial handshake allows client/server capabilities negociation. Oracle has copyrighted a poem that the clients needs to send to make sure reverse engineered drivers are not possible: https://noss.github.io/2009/04/28/reverse-engineering-oracle-protocol.html https://noss.github.io/2009/04/28/reverse-engineering-oracle... Business as usual for Oracle and their horrible ethics...
- userbinator 8y agoODBC isn't a "database" per se, but a standard interface that can access any database with an ODBC driver. ...and although I'm not familiar with all of the others in that list, the ones that I do recognise have ODBC drivers.
- staz 8y agoI read that has the client having specific support for these DB but a fallback to generic ODBC otherwhise
- kenshaw 8y agoYes and no. ODBC on Windows may (or may not) be provided by the Microsoft JET driver, which can be considered a database unto itself. Specifically, there is a separate ODBC driver for Go that usql supports, which is what this is reflective of. I actually edited the above after posting to remove a double entry for PostgreSQL and MySQL, as there are two different Go drivers for each of those databases (4 in total) that are well supported by the community.
- bobbydreamer 8y agoNo Db2
- SloopJon 8y agoWhen I type help, the characters aren't echoed to the screen, but backslash commands are: $ ./usql Type "help" for help. (not connected)=> You are using usql, ... Type: \copyright for distribution terms \? for help with usql commands \g or terminate with semicolon ... \q to quit (not connected)=> \q $ Is this expected? Edit: I'm using the binary package on macOS 10.12.6.
- kenshaw 8y agoThis is a syntax highlighting issue, most likely. The \ commands are not highlighted. Are you using a white or light colored background? Likely the contrast isn't high enough. I just updated the documentation with more information on controlling syntax highlighting. You can either try disabling syntax highlighting completely ( \set SYNTAX_HL false ) or change the Chroma style used ( \set SYNTAX_HL_STYLE paraiso-light ) See this page: https://xyproto.github.io/splash/docs/all.html https://xyproto.github.io/splash/docs/all.html for an example of what the various Chroma styles should look like.