SQLiteDF.jl is a simple package with currently one macro
@sqlitedf a,b,c,...,"select * from .."
in the context where it’s called it loads the data from Tables.jl compatible variables named a,b,c etc into a new in-memory SQLite database using the same names, and then calls the query and returns the results, which can for example be piped into a DataFrame.
I’m thinking of adding a few additional similar macros, maybe something like
@withsqlitedb db, a,b,c,..., expr
which would create a new in memory sqlite database called “db” load the a,b,c… tables into it and then evaluate the expr where the expr could do arbitrary stuff to the db.
Basically the reason this needs to be macros is so that it can capture the names a,b,c and create the appropriate named tables so that the names match in the SQLite db. Unless I’m mistaken.
This is both my first Julia package, and my first foray into metaprogramming in Julia (I’ve written macros in Common Lisp, ages ago).
Any constructive criticism, suggestions, or bug reports welcome.
Apparently back in 2014 or so the SQLite.jl library had its own sqldf macro, but it was removed at one point, and I’m not sure why.