# \[ANN\] SQLdf - SQL for Julia types implementing Tables.jl

**URL:** <https://discourse.julialang.org/t/ann-sqldf-sql-for-julia-types-implementing-tables-jl/66380>\
**Category:** Package Announcements\
**Created:** [August 14, 2021, 8:35am UTC](https://discourse.julialang.org/t/ann-sqldf-sql-for-julia-types-implementing-tables-jl/66380 "2021-08-14T08:35:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![viraltux](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/viraltux/32/15236_2.png) [@viraltux](https://discourse.julialang.org/u/viraltux)\
**Post date:** [August 14, 2021, 8:35am UTC](https://discourse.julialang.org/t/ann-sqldf-sql-for-julia-types-implementing-tables-jl/66380/1 "2021-08-14T08:35:43Z")

</div>

Latest version `0.2.0` of [SQLdf](https://github.com/viraltux/SQLdf.jl) uses as default RDB engine [SQLite.jl](https://github.com/JuliaDatabases/SQLite.jl) instead accessing `R/sqldf` via `RCall`. This latest version and its default has the following new features:

- More responsive access to SQLite
- Ability to query any Julia type implementing `Tables.jl` interface
- Ability to mix in the same query Julia types implementing `Tables.jl` interface
- @sqldf macro

Regardless the types used in the query the result will always be a DataFrame. Below there is an example joining a `DataFrame` and a `TimeArray` with duplicated column names.

**Note:** In this version it is still possible to access `R/sqldf` by using the command `setRDB("R")`, to set `sqldf`’s default back to `SQLite.jl` we need to use `setRDB("SQLite")`.

```julia
using SQLdf, TimeSeries
DF = DataFrame(a=1:14, b=14:-1:1, c = split("Julia is great",""))
TA = TimeArray(Date(2021, 1, 1):Day(1):Date(2021, 1, 14), 1:14)

julia> @sqldf "select * from TA join DF where TA.A = DF.a"
14×5 DataFrame
 Row │ timestamp A a:1 b c      
     │ Date Int64 Int64 Int64 String 
─────┼─────────────────────────────────────────
   1 │ 2021-01-01 1 1 14 J
   2 │ 2021-01-02 2 2 13 u
   3 │ 2021-01-03 3 3 12 l
   4 │ 2021-01-04 4 4 11 i
   5 │ 2021-01-05 5 5 10 a
   6 │ 2021-01-06 6 6 9
   7 │ 2021-01-07 7 7 8 i
   8 │ 2021-01-08 8 8 7 s
   9 │ 2021-01-09 9 9 6
  10 │ 2021-01-10 10 10 5 g
  11 │ 2021-01-11 11 11 4 r
  12 │ 2021-01-12 12 12 3 e
  13 │ 2021-01-13 13 13 2 a
  14 │ 2021-01-14 14 14 1 t

```
