You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: test/sqlite.spec.js
+26Lines changed: 26 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -213,4 +213,30 @@ describe('sqlite', () => {
213
213
);`
214
214
expect(getParsedSql(sql)).to.be.equal(`CREATE TABLE IF NOT EXISTS "__EFMigrationsHistory" ("MigrationId" TEXT NOT NULL CONSTRAINT "PK___EFMigrationsHistory" PRIMARY KEY, "ProductVersion" TEXT NOT NULL)`)
215
215
})
216
+
217
+
it('should support INSERT ... RETURNING *',()=>{
218
+
constsql=`INSERT INTO users (email) VALUES (?) RETURNING *`
219
+
expect(getParsedSql(sql)).to.be.equal(`INSERT INTO "users" (email) VALUES (?) RETURNING *`)
220
+
})
221
+
it('should support INSERT ... RETURNING specific columns',()=>{
222
+
constsql=`INSERT INTO users (email) VALUES (?) RETURNING id, email as email_address`
223
+
expect(getParsedSql(sql)).to.be.equal(`INSERT INTO "users" (email) VALUES (?) RETURNING "id", "email" AS "email_address"`)
224
+
})
225
+
it('should support UPDATE ... RETURNING *',()=>{
226
+
constsql=`UPDATE users SET email = ? RETURNING *`
227
+
expect(getParsedSql(sql)).to.be.equal(`UPDATE "users" SET "email" = ? RETURNING *`)
228
+
})
229
+
it('should support UPDATE ... RETURNING specific columns',()=>{
230
+
constsql=`UPDATE users SET email = ? RETURNING id, email as email_address`
231
+
expect(getParsedSql(sql)).to.be.equal(`UPDATE "users" SET "email" = ? RETURNING "id", "email" AS "email_address"`)
232
+
})
233
+
it('should support DELETE ... RETURNING *',()=>{
234
+
constsql=`DELETE FROM users WHERE last_login > ? RETURNING *`
235
+
expect(getParsedSql(sql)).to.be.equal(`DELETE FROM "users" WHERE "last_login" > ? RETURNING *`)
236
+
})
237
+
it('should support DELETE ... RETURNING *',()=>{
238
+
constsql=`DELETE FROM users WHERE last_login > ? RETURNING id, email as email_address`
239
+
expect(getParsedSql(sql)).to.be.equal(`DELETE FROM "users" WHERE "last_login" > ? RETURNING "id", "email" AS "email_address"`)
0 commit comments