Yes to both!
For the first one, you want to use Data.stream! to get a Data.Table from
the result set, and then convert it to a DataFrame. For the second you
need to do the opposite. I generally work with DataFrames so I wrote two
convenience functions for doing this, which should give you an idea of how
to go about it:
function queryToDF(db, query)
source = SQLite.Source(db, query)
return DataFrame(Data.stream!(source, Data.Table))
end
function dfToDB(db, df, table)
sink = SQLite.Sink(Data.Table(df), db, table)
Data.stream!(Data.Table(df), sink)
end
Cheers -A
On Wednesday, May 25, 2016 at 2:54:26 AM UTC-7, SHORE SHEN wrote:
>
> Hello
>
> Im trying out the sqlite package in julia, I got the following 2 questions:
>
> 1, the query will result in a type of SQLite.ResultSet, if i can output
> dataframe or dataarry type?
>
> 2, if i have a dataframe or dataarray type, would i be able to put it into
> the database table?
>
> thanks a lot!
>