virtual class slanRecord::Context
sys::Obj slanRecord::Context
session and manager
- checkTable
-
check the object table is fit to database table
- checkTableT
-
Bool checkTableT(TableDef table)
check the object table is fit to database table
- close
-
Void close()
- conn
-
SqlConn? conn
Get the connection to this database for the current thread.
- count
-
count by example
- createTable
- createTableT
- deleteByExample
-
virtual Void deleteByExample(Obj obj)
delete by example
- deleteById
-
virtual Void deleteById(Type table, Obj id)
delete by id
- deleteByIdT
- dropTable
- dropTableT
- execute
-
Int execute(Str sql, List<Obj>? params)
execute raw sql
- exist
-
exist by example, this operate noCache
- findById
- findByIdT
- getTable
- insert
-
insert this obj to database
- list
-
List<Obj> list(Obj obj, Str orderby := "", Int offset := 0, Int limit := 50)
select by example
- make
-
new make(SqlConn conn)
constructor
- one
-
Obj? one(Obj obj, Str orderby := "", Int offset := 0)
select by example and get the first one
- query
-
List<Obj> query(Str sql, List<Obj>? params, Type? type := null, Int offset := 0, Int limit := 50)
query by raw sql
- queryT
-
List<Obj> queryT(Str sql, List<Obj>? params, TableDef? table := null, Int offset := 0, Int limit := 50)
- save
-
update or insert
- select
-
List<Obj> select(Type type, Str where, Int offset := 0, Int limit := 50)
query by condition
- selectT
-
List<Obj> selectT(TableDef table, Str where, Int offset := 0, Int limit := 50)
- tableExists
- tableExistsT
- toTable
- trans
-
virtual Void trans(Func<Void,This> f)
transaction , if error will auto roolback
- updateByCondition
- updateByExample
- updateById
-
virtual Void updateById(Obj obj)
update by id