Skip to content

Instantly share code, notes, and snippets.

@jamilhf
jamilhf / SQL_COOKBOOK_TABLE.sql
Created March 29, 2019 14:07
SQL Cookbook table
--jam
DROP TABLE IF EXISTS emp;
CREATE TABLE emp (
empno decimal(4,0) NOT NULL,
ename varchar(10) default NULL,
job varchar(9) default NULL,
mgr decimal(4,0) default NULL,
hiredate date default NULL,
module.exports = function() {
Cypress.Commands.add('sqlServer', (query) => {
if(!query) {
throw new Error('Query must be set');
}
cy.task('sqlServer:execute', query).then(response => {
let result = [];
const flatten = r => Array.isArray(r) && r.length === 1 ? flatten(r[0]) : r;
module.exports = function() {
Cypress.Commands.add('sqlServer', (query) => {
if(!query) {
throw new Error('Query must be set');
}
cy.task('sqlServer:execute', query).then(response => {
let result = [];
const flatten = r => Array.isArray(r) && r.length === 1 ? flatten(r[0]) : r;