I want to make Core as much abstract as possible, allowing to rely on paradigms other than SQL, e.g. Tarantool. Existing architecture is suitable for SQL back-ends only.
require "core"
struct User
include Core::SQL::Schema
include Core::SQL::Query
include Core::Validation
schema :users do
primary_key :id
field :name, String
end
end
repo = Core::SQL::Repository.new(db)
user = repo.query(User.where("id > ?", 42)
And with community shard "core-tarantool":
require "core-tarantool"
struct User
include Core::Tarantool::Schema
include Core::Validation
schema :users do
primary_index :id
field :name, String
end
end
repo = Core::Tarantool::Repository.new(tnt)
user = repo.select(User, :id, :>, 42) # Select User where id > 42
I want to make Core as much abstract as possible, allowing to rely on paradigms other than SQL, e.g. Tarantool. Existing architecture is suitable for SQL back-ends only.
And with community shard "core-tarantool":