# Configure is optional, memory adapter is default
Core.configure do |config|
config.adapter = :sql
config.dsn = 'sqlite::memory'
end
Core.load.finalize
Core.command(:users).create.call(name: 'test', email: '[email protected]')
Core.command(:users).create.call(name: 'test1', email: '[email protected]')
Core.command(:users).create.call(name: 'test2', email: '[email protected]')
Core.relation(:users).
filter(:name, :gt, 'test').
offset(1).
limit(1).
as(:entity).
to_a # => [#<Core::Models::User:0x007f1de86da468 @name="test2", @email="[email protected]">]
Core.relation(:users).
filter(:name, :gt, 'test').
order(:name, :desc).
offset(1).
limit(1).
as(:entity).
to_a # => [#<Core::Models::User:0x007fed7e526e30 @name="test1", @email="[email protected]">]