[ANN] DBInterface.jl, MySQL.jl 1.0, and SQLite.jl 1.0

Sorry for all the posting lately, but I’ve been trying to coordinate a few 1.0 releases, so bear with me :sweat_smile:

This is the first official announcement of the new DBInterface.jl package, aiming to provide a standard API for database packages. The API aims to be pretty minimal to start out, to encourage adoption and avoid “over-engineering” things at the start, and new features can be added over time as more packages implement and usage grows. Currently, usage is:

  • DBInterface.connect(T, args...; kw...): open a T kind of database connection
  • DBInterface.prepare(conn, sql): prepare a SQL statement for execution
  • DBInterface.execute(stmt, params): Execute a statement, optionally binding parameters; returns a “cursor”, which is an iterator of rows

Along with this announcement is the official announcement of the 1.0 releases of the MySQL.jl and SQLite.jl packages. Highlights include:

  • The first implementations of the DBInterface interfaces
  • Fixing of a bunch of bugs/long-standing issues
  • Improved documentations

For SQLite.jl, there were two breaking changes introduced, including:

  • SQLite.execute! is now just SQLite.execute
  • SQLite.Query is now DBInterface.execute: for executing and returning query results

For MySQL.jl, the package was overhauled quite extensively:

  • Full support for prepared statements, with parameter binding, and returning binary results through bound buffers
  • DBInterface.connect for opening connections, with keyword argument support for the many many configuration options for connections
  • Ability to use a .ini file for specifying configuration options
  • Full C API function wrappers in case you need additional functionality
  • Usage of the new MariaDB_jll.jl BinaryBuilder solution for the client library (thanks @giordano!)

Please open issues if you run into things in the respective repos, or drop by the #databases slack channel to discuss as well.

Cheers!

-Jacob

48 Likes

Are there any plans for DBInterface to support ODBC or MS SQL Server directly?

My actual usecase is that I need to pull data from MS SQL Server and have had a number of issues trying to build a DataFrame from SQL Server lately. There seem to be some strange package dependency interactions between ODBC, Tables, and DataFrames at the moment.

At the moment, ODBC v0.8.1 seems to work but downgrades Tables to v0.2.11. ODBC v0.8.5 fails on the same query that works with v0.8.1.

I have opened an issue (#255) about this for ODBC.

1 Like

Will julia have an api to duckdb with DBI interface? Duckdb is very fast with large data and much easier to understand than juliadb.

1 Like

Yes, I’m planning on updating ODBC.jl to support DBInterface.jl and Tables.jl 1.0. Hopefully in the next few days.

5 Likes

If someone writes a package for it! Volunteers welcome!

3 Likes

Thank you, Jacob. ODBC 9.0 resolves my problems pulling data from MS SQL Server.

I will close ODBC issue #255.