From c7e743527f5cb3b6266dd683521635336265162c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vin=C3=ADcius=20Garcia?= Date: Tue, 10 Nov 2020 11:16:39 -0300 Subject: [PATCH] Add README.md --- README.md | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..bdb7dd2 --- /dev/null +++ b/README.md @@ -0,0 +1,35 @@ + +# 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: + +```go +// 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.