News for hackers. Stuff that matters.
Re:Usql: v0.7.0 released by kenshaw on Tuesday June 12, 2018 @08:59PM (#17299420)
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.
Re:Usql: v0.7.0 released by bruce_one on Wednesday June 13, 2018 @12:39AM (#17300297)
100% 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 :-)

Re:Usql: v0.7.0 released by kenshaw on Wednesday June 13, 2018 @01:30AM (#17300486)
Yes, I've been working on a 100% native Go driver for Oracle. It is not even alpha or beta quality at this time.
Re:Usql: v0.7.0 released by grumpydba on Wednesday June 13, 2018 @01:46AM (#17300562)
Hi, can I see the code, and can I help? I have a beta SAP ASE driver that should come out soon, BTW.
Re:Usql: v0.7.0 released by kenshaw on Wednesday June 13, 2018 @02:12AM (#17300673)
It'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.

Re:Usql: v0.7.0 released by grumpydba on Wednesday June 13, 2018 @03:25AM (#17301021)
Someone has already been there, the protocol is very.. rich, I would say:

https://blog.pythian.com/repost-oracle-protocol/

Re:Usql: v0.7.0 released by tracker1 on Wednesday June 13, 2018 @03:38AM (#17301074)
Hell, 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.
Re:Usql: v0.7.0 released by emmelaich on Wednesday June 13, 2018 @06:14AM (#17301778)
Then it would difficult to change.

For instance to support clusters and failover.

Re:Usql: v0.7.0 released by grumpydba on Wednesday June 13, 2018 @07:42AM (#17302149)
MSSQL 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...

Business as usual for Oracle and their horrible ethics...

Re:Usql: v0.7.0 released by SloopJon on Wednesday June 13, 2018 @04:08PM (#17306492)
When 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.

Re:Usql: v0.7.0 released by kenshaw on Wednesday June 13, 2018 @05:36PM (#17307179)
This 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 for an example of what the various Chroma styles should look like.

Re:Usql: v0.7.0 released by userbinator on Wednesday June 13, 2018 @07:35AM (#17302115)
ODBC 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.

Re:Usql: v0.7.0 released by kenshaw on Wednesday June 13, 2018 @03:04PM (#17306042)
Yes 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.
Re:Usql: v0.7.0 released by staz on Wednesday June 13, 2018 @08:00AM (#17302245)
I read that has the client having specific support for these DB but a fallback to generic ODBC otherwhise
Re:Usql: v0.7.0 released by bobbydreamer on Wednesday June 13, 2018 @03:43PM (#17306315)
No Db2