diff --git a/.wappler/targets/Development/app/modules/connections/ERTdb.json b/.wappler/targets/Development/app/modules/connections/DB.json similarity index 61% rename from .wappler/targets/Development/app/modules/connections/ERTdb.json rename to .wappler/targets/Development/app/modules/connections/DB.json index 6afbb54..ceb67ac 100644 --- a/.wappler/targets/Development/app/modules/connections/ERTdb.json +++ b/.wappler/targets/Development/app/modules/connections/DB.json @@ -1,13 +1,12 @@ { - "name": "ERTdb", + "name": "DB", "module": "dbconnector", "action": "connect", "options": { "client": "sqlite3", "connection": { - "filename": "/ERTSQlite.db" + "filename": "/public/ERTSQlite.db" }, "tz": "utc" - }, - "fileName": "ERTdb.json" + } } \ No newline at end of file diff --git a/.wappler/targets/Development/databases/ERTdb.json b/.wappler/targets/Development/databases/DB.json similarity index 91% rename from .wappler/targets/Development/databases/ERTdb.json rename to .wappler/targets/Development/databases/DB.json index 16fb2ed..a60288a 100644 --- a/.wappler/targets/Development/databases/ERTdb.json +++ b/.wappler/targets/Development/databases/DB.json @@ -1,17 +1,20 @@ { "type": "sqlite3", "connection": { - "filename": "/ERTSQlite.db" + "filename": "/public/ERTSQlite.db" }, "direct": true, "schema": { "tables": { + "_da_old_20241029": { + "db": {} + }, "da": { "db": {}, "columns": { "ID": { "db": { - "type": "integer", + "type": "increments", "primary": true, "unique": false, "nullable": false diff --git a/ERTSQlite.db b/ERTSQlite.db index 839dbe5..954eec7 100644 Binary files a/ERTSQlite.db and b/ERTSQlite.db differ diff --git a/app/api/DSremove.json b/app/api/DSremove.json deleted file mode 100644 index 18cca0a..0000000 --- a/app/api/DSremove.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "exec": {} -} \ No newline at end of file diff --git a/app/api/delRecord.json b/app/api/delRecord.json new file mode 100644 index 0000000..9c25c84 --- /dev/null +++ b/app/api/delRecord.json @@ -0,0 +1,60 @@ +{ + "meta": { + "$_POST": [ + { + "type": "text", + "name": "deleteid" + } + ] + }, + "exec": { + "steps": { + "name": "delete", + "module": "dbupdater", + "action": "delete", + "options": { + "connection": "DB", + "sql": { + "type": "delete", + "table": "da", + "wheres": { + "condition": "AND", + "rules": [ + { + "id": "ID", + "field": "ID", + "type": "double", + "operator": "equal", + "value": "{{$_POST.deleteid}}", + "data": { + "column": "ID" + }, + "operation": "=" + } + ], + "conditional": null, + "valid": true + }, + "returning": "ID", + "query": "delete from `da` where `ID` = ?", + "params": [ + { + "operator": "equal", + "type": "expression", + "name": ":P1", + "value": "{{$_POST.deleteid}}", + "test": "" + } + ] + } + }, + "meta": [ + { + "name": "affected", + "type": "number" + } + ], + "output": true + } + } +} \ No newline at end of file diff --git a/app/api/insert.json b/app/api/insert.json new file mode 100644 index 0000000..574aef4 --- /dev/null +++ b/app/api/insert.json @@ -0,0 +1,116 @@ +{ + "meta": { + "$_POST": [ + { + "type": "text", + "name": "db_fullName" + }, + { + "type": "text", + "name": "db_licenseNumber" + }, + { + "type": "text", + "name": "db_stateIssue" + }, + { + "type": "number", + "name": "db_employeeID" + }, + { + "type": "text", + "name": "owner" + } + ] + }, + "exec": { + "steps": { + "name": "insert", + "module": "dbupdater", + "action": "insert", + "options": { + "connection": "DB", + "sql": { + "type": "insert", + "values": [ + { + "table": "da", + "column": "db_fullName", + "type": "text", + "value": "{{$_POST.db_fullName}}" + }, + { + "table": "da", + "column": "db_licenseNumber", + "type": "text", + "value": "{{$_POST.db_licenseNumber}}" + }, + { + "table": "da", + "column": "db_stateIssue", + "type": "text", + "value": "{{$_POST.db_stateIssue}}" + }, + { + "table": "da", + "column": "db_employeeID", + "type": "number", + "value": "{{$_POST.db_employeeID}}" + }, + { + "table": "da", + "column": "owner", + "type": "text", + "value": "{{$_POST.owner}}" + } + ], + "table": "da", + "returning": "ID", + "query": "insert into `da` (`db_employeeID`, `db_fullName`, `db_licenseNumber`, `db_stateIssue`, `owner`) values (?, ?, ?, ?, ?) returning `ID`", + "params": [ + { + "name": ":P1", + "type": "expression", + "value": "{{$_POST.db_fullName}}", + "test": "" + }, + { + "name": ":P2", + "type": "expression", + "value": "{{$_POST.db_licenseNumber}}", + "test": "" + }, + { + "name": ":P3", + "type": "expression", + "value": "{{$_POST.db_stateIssue}}", + "test": "" + }, + { + "name": ":P4", + "type": "expression", + "value": "{{$_POST.db_employeeID}}", + "test": "" + }, + { + "name": ":P5", + "type": "expression", + "value": "{{$_POST.owner}}", + "test": "" + } + ] + } + }, + "meta": [ + { + "name": "identity", + "type": "text" + }, + { + "name": "affected", + "type": "number" + } + ] + } + } +} \ No newline at end of file diff --git a/app/api/dbQuery.json b/app/api/query.json similarity index 95% rename from app/api/dbQuery.json rename to app/api/query.json index e53ce8d..aa728d8 100644 --- a/app/api/dbQuery.json +++ b/app/api/query.json @@ -17,7 +17,7 @@ "module": "dbconnector", "action": "select", "options": { - "connection": "ERTdb", + "connection": "DB", "sql": { "type": "select", "columns": [], @@ -27,7 +27,6 @@ }, "primary": "ID", "joins": [], - "orders": [], "query": "select * from `da`" } }, diff --git a/app/modules/connections/ERTdb.json b/app/modules/connections/DB.json similarity index 61% rename from app/modules/connections/ERTdb.json rename to app/modules/connections/DB.json index 6afbb54..ceb67ac 100644 --- a/app/modules/connections/ERTdb.json +++ b/app/modules/connections/DB.json @@ -1,13 +1,12 @@ { - "name": "ERTdb", + "name": "DB", "module": "dbconnector", "action": "connect", "options": { "client": "sqlite3", "connection": { - "filename": "/ERTSQlite.db" + "filename": "/public/ERTSQlite.db" }, "tz": "utc" - }, - "fileName": "ERTdb.json" + } } \ No newline at end of file diff --git a/public/ERTSQlite.db b/public/ERTSQlite.db new file mode 100644 index 0000000..b55d7c6 Binary files /dev/null and b/public/ERTSQlite.db differ diff --git a/public/dmxAppConnect/config.js b/public/dmxAppConnect/config.js index d9cf58b..e69de29 100644 --- a/public/dmxAppConnect/config.js +++ b/public/dmxAppConnect/config.js @@ -1,44 +0,0 @@ -dmx.config({ - "main": { - "datastore1": [ - { - "type": "boolean", - "name": "dirty" - } - ] - }, - "index": { - "datastore1": [ - { - "type": "text", - "name": "da_fullName" - }, - { - "type": "text", - "name": "da_driverLicense" - }, - { - "type": "text", - "name": "da_driverLicenseState" - } - ], - "dataID": { - "outputType": "text" - }, - "DSflow1": { - "meta": {}, - "local": [ - { - "name": "DSConfirm", - "type": "boolean", - "metaData": { - "confirmMessage": { - "meta": null, - "outputType": "text" - } - } - } - ] - } - } -}); diff --git a/public/trainer.json b/public/trainer.json new file mode 100644 index 0000000..c05e49e --- /dev/null +++ b/public/trainer.json @@ -0,0 +1,11 @@ +{ + "Trainer": { + "Jeff": {}, + "Amy": {}, + "Justin": {}, + "Teresa": {}, + "Angie": {}, + "Valerie": {}, + "Pree": {} + } +} \ No newline at end of file diff --git a/views/index.ejs b/views/index.ejs index 6af5530..63dfa1b 100644 --- a/views/index.ejs +++ b/views/index.ejs @@ -1,5 +1,7 @@ - + +
+ - +
- - - - - - - - - - - - - - - - - -
$idDa full nameDa driver licenseDa driver license state
- - -
+ + + + + + + + + + + + + + + + + + + + + +
IdDb full nameDb license numberDb state issueDb employeeOwner
+
+ + +
+ +
-

No Records

+

{{DBSC1.data.query.count()+" Records"}}

diff --git a/views/layouts/main.ejs b/views/layouts/main.ejs index 049b684..eb6f747 100644 --- a/views/layouts/main.ejs +++ b/views/layouts/main.ejs @@ -24,7 +24,6 @@ -