From 501560896f7f84dc8e4a06ca99d9bcd3a799f13e Mon Sep 17 00:00:00 2001 From: Zongmin Lei Date: Sat, 24 Nov 2018 22:23:09 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0README?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/README.md b/README.md index 8ac4172..78f310a 100644 --- a/README.md +++ b/README.md @@ -57,8 +57,48 @@ Q.select() .limit(3) .build(); // SELECT `A`.*, `B`.* FROM `hello` AS `A` LEFT JOIN `world` AS `B` ON A.id=B.id WHERE 1 AND 2 LIMIT 2,3 + +Q.table("test1") + .insert({ + a: 123, + b: 456, + }) + .build(); +// INSERT INTO `test1` (`a`, `b`) VALUES (123, 456); + +Q.table("test1") + .insert([ + { + a: 123, + b: 456, + }, + { + a: 789, + b: 110, + }, + ]) + .build(); +// INSERT INTO `test1` (`a`, `b`) VALUES (123, 456), +// (789, 110)"); + +Q.table("test1") + .update({ + a: 123, + b: 456, + }) + .where({ + b: 777, + }) + .limit(12) + .build(); +// UPDATE `test1` SET `a`=123, `b`=456 WHERE `b`=777 LIMIT 12 ``` +详细是要方法可以参考单元测试: + +- https://github.com/leizongmin/leizm-sql/blob/master/src/test/query1.test.ts +- https://github.com/leizongmin/leizm-sql/blob/master/src/test/query2.test.ts + ## License ```text