soul-cli 0.3.6 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "soul-cli",
3
- "version": "0.3.6",
3
+ "version": "0.4.0",
4
4
  "description": "A SQLite REST and Realtime server",
5
5
  "main": "src/server.js",
6
6
  "bin": {
@@ -69,7 +69,7 @@ const createTable = async (req, res) => {
69
69
  // add id if primary key is not defined
70
70
  if (!schema.find((field) => field.primaryKey)) {
71
71
  schemaString = `
72
- id INTEGER PRIMARY KEY AUTOINCREMENT,
72
+ id INTEGER PRIMARY KEY AUTOINCREMENT,
73
73
  ${schemaString}
74
74
  `;
75
75
  }
@@ -92,7 +92,7 @@ const createTable = async (req, res) => {
92
92
  let indicesString = indices
93
93
  .map((field) => {
94
94
  return `
95
- CREATE INDEX ${tableName}_${field}_index
95
+ CREATE INDEX ${tableName}_${field}_index
96
96
  ON ${tableName} (${field})
97
97
  `;
98
98
  })
@@ -162,7 +162,7 @@ const listTables = async (req, res) => {
162
162
  */
163
163
  const { _search, _ordering } = req.query;
164
164
 
165
- let query = `SELECT name FROM sqlite_master WHERE type = 'table'`;
165
+ let query = `SELECT name FROM sqlite_master WHERE type IN ('table', 'view')`;
166
166
 
167
167
  // if search is provided, search the tables
168
168
  // e.g. ?_search=users
@@ -237,7 +237,7 @@ const deleteTable = async (req, res) => {
237
237
  type: 'string',
238
238
  description: 'Name of the table'
239
239
  }
240
-
240
+
241
241
  */
242
242
  const { name: tableName } = req.params;
243
243
  const query = `DROP TABLE ${tableName}`;