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
+11
Original file line number
Diff line number
Diff line change
@@ -183,4 +183,15 @@ describe('sqlite', () => {
183
183
constsql="SELECT * FROM sqlite_master WHERE name == 'test'"
184
184
expect(getParsedSql(sql)).to.be.equal(`SELECT * FROM "sqlite_master" WHERE "name" == 'test'`)
185
185
})
186
+
187
+
it('should support subquery',()=>{
188
+
constsql=`SELECT SUM("Hours Spent") AS "Total Hours"
189
+
FROM "Work_Records"
190
+
WHERE "Partner ID" =
191
+
(SELECT "Partner ID"
192
+
FROM "Employees"
193
+
WHERE "Firstname" = 'John' AND "Lastname" = 'Smith')
194
+
`
195
+
expect(getParsedSql(sql)).to.be.equal(`SELECT SUM("Hours Spent") AS "Total Hours" FROM "Work_Records" WHERE "Partner ID" = (SELECT "Partner ID" FROM "Employees" WHERE "Firstname" = 'John' AND "Lastname" = 'Smith')`)
0 commit comments