mirror of
https://github.com/VinGarcia/ksql.git
synced 2025-07-12 15:19:13 +00:00
This commit adds the concept of dialects so we can support different ways of escaping names, creating placeholders, etc. Currently we are only using it on the Insert route and we only support postgres and sqlite3, in the future we should add more tests so we can start supporting more drivers.
KissORM
Welcome to the KissORM project, o the Keep It Simple Stupid micro ORM.
This ORM was created to be used by any developer efficiently and safely. The goals were:
- We'll not let you shoot your own foot
- Testing should be simple and clear for readers
- The learning curve should be minimal, so we are aiming on a very slim interface
Note: Currently we use GORM internally because we needed a working version asap in order to use it on our next project, however, this is temporary and we are already removing this dependency.
Kiss Interface
The current interface is as follows:
// ORMProvider describes the public behavior of this ORM
type ORMProvider interface {
Insert(ctx context.Context, records ...interface{}) error
Delete(ctx context.Context, ids ...interface{}) error
Update(ctx context.Context, records ...interface{}) error
Query(ctx context.Context, records interface{}, query string, params ...interface{}) error
QueryOne(ctx context.Context, record interface{}, query string, params ...interface{}) error
QueryChunks(ctx context.Context, parser ChunkParser) error
}
You might notice that we are currently lacking an Exec()
function and a abstraction for transactions, but it is on our TODO list.
Languages
Go
98.3%
Makefile
1.1%
Shell
0.6%