-
-
Notifications
You must be signed in to change notification settings - Fork 8
Closed
Description
Thanks for writing such a nice DSL! I tried to use Octo with SQLite:
using Octo.Adapters.SQLite
Repo.debug_sql()
Repo.connect(
adapter = Octo.Adapters.SQLite,
dbfile = ":memory:",
)
struct Employee end
Schema.model(Employee, table_name="Employee", primary_key="ID")
Repo.execute([DROP TABLE IF EXISTS Employee])
Repo.execute(Raw("""
CREATE TABLE Employee (
ID SERIAL,
Name VARCHAR(255),
Salary FLOAT(8),
PRIMARY KEY (ID)
)"""))
Repo.insert!(Employee, [
(Name="Jeremy", Salary=10000.50),
(Name="Cloris", Salary=20000.50),
(Name="John", Salary=30000.50),
(Name="Hyunden", Salary=40000.50),
(Name="Justin", Salary=50000.50),
(Name="Tom", Salary=60000.50),
])but I got this error:
ERROR: LoadError: MethodError: no method matching SQLite.Query(::SQLite.DB, ::String)
Closest candidates are:
SQLite.Query(::Any, ::Any, ::Any, ::Any, ::Any) at ~/.julia/packages/SQLite/DRKy9/src/tables.jl:6
Stacktrace:
[1] execute(::String) at ~/.julia/packages/Octo/KXrAr/src/Backends/SQLite.jl:42
[2] execute(::Array{Any,2}) at ~/.julia/packages/Octo/KXrAr/src/Repo.jl:300
[3] top-level scope at ~/src/OctoProject/src/octo.jl:10
[4] include at ./boot.jl:328 [inlined]
[5] include_relative(::Module, ::String) at ./loading.jl:1105
[6] include(::Module, ::String) at ./Base.jl:31
[7] include(::String) at ./client.jl:424
[8] top-level scope at REPL[1]:1
in expression starting at ~/src/OctoProject/src/octo.jl:10Perhaps the API of SQLite.jl has changed or I'm doing something wrong.
Metadata
Metadata
Assignees
Labels
No labels