@saltcorn/sql 0.3.0 → 0.3.1

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": "@saltcorn/sql",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "Actions and views based on SQL",
5
5
  "main": "index.js",
6
6
  "dependencies": {
package/table-provider.js CHANGED
@@ -60,6 +60,9 @@ const configuration_workflow = (req) =>
60
60
  })),
61
61
  qres.rows?.slice?.(0, 5)
62
62
  );
63
+ const pkey_options = getState().type_names.filter(
64
+ (tnm) => getState().types[tnm]?.primaryKey
65
+ );
63
66
  const theForm = new Form({
64
67
  blurb: pre(code(qres.query)) + tbl,
65
68
  fields: [
@@ -89,6 +92,12 @@ const configuration_workflow = (req) =>
89
92
  required: true,
90
93
  attributes: { options: getState().type_names },
91
94
  },
95
+ {
96
+ name: "primary_key",
97
+ label: "Primary key",
98
+ type: "Bool",
99
+ showIf: { type: pkey_options },
100
+ },
92
101
  ],
93
102
  }),
94
103
  ],