@snowtop/ent 0.1.0-alpha108 → 0.1.0-alpha110

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": "@snowtop/ent",
3
- "version": "0.1.0-alpha108",
3
+ "version": "0.1.0-alpha110",
4
4
  "description": "snowtop ent framework",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -199,9 +199,13 @@ function processAction(action) {
199
199
  if (f.nullable === "contentsAndList") {
200
200
  f2.nullable = NullableResult.CONTENTS_AND_LIST;
201
201
  }
202
- else {
202
+ else if (f.nullable === "contents") {
203
203
  f2.nullable = NullableResult.CONTENTS;
204
204
  }
205
+ else if (f.nullable === "true") {
206
+ // shouldn't happen but ran into weirdness where it did...
207
+ f2.nullable = NullableResult.ITEM;
208
+ }
205
209
  }
206
210
  return f2;
207
211
  });
package/schema/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import Schema from "./schema";
2
2
  export { Schema };
3
- export { Field, AssocEdge, AssocEdgeGroup, InverseAssocEdge, Edge, Pattern, DBType, Type, FieldOptions, SchemaConstructor, SchemaInputType, getFields, getFieldsWithPrivacy, getStorageKey, ActionOperation, Action, EdgeAction, NoFields, FieldMap, Constraint, Index, ConstraintType, ForeignKeyInfo, requiredField, optionalField, UpdateOperation, TransformedUpdateOperation, SQLStatementOperation, EdgeUpdateOperation, TransformedEdgeUpdateOperation, getTransformedReadClause, getObjectLoaderProperties, GlobalSchema, } from "./schema";
3
+ export { Field, AssocEdge, AssocEdgeGroup, InverseAssocEdge, Edge, Pattern, DBType, Type, FieldOptions, SchemaConstructor, SchemaInputType, getFields, getFieldsWithPrivacy, getStorageKey, ActionOperation, Action, EdgeAction, NoFields, FieldMap, Constraint, Index, ConstraintType, ForeignKeyInfo, requiredField, optionalField, UpdateOperation, TransformedUpdateOperation, SQLStatementOperation, EdgeUpdateOperation, TransformedEdgeUpdateOperation, getTransformedReadClause, getObjectLoaderProperties, GlobalSchema, ActionField, } from "./schema";
4
4
  export { Timestamps, Node, BaseEntSchema, BaseEntSchemaWithTZ, EntSchema, EntSchemaWithTZ, SchemaConfig, } from "./base_schema";
5
5
  export * from "./field";
6
6
  export * from "./json_field";
@@ -264,6 +264,7 @@ export interface ActionField {
264
264
  name: string;
265
265
  type: actionFieldType;
266
266
  nullable?: boolean | NullableListOptions;
267
+ optional?: boolean;
267
268
  list?: boolean;
268
269
  actionName?: string;
269
270
  excludedFields?: string[];
package/schema/schema.js CHANGED
@@ -160,6 +160,9 @@ function getTransformedReadClause(value) {
160
160
  return;
161
161
  }
162
162
  exports.getTransformedReadClause = getTransformedReadClause;
163
+ // would like to avoid calling this so that itwe don't run into circular dependencies
164
+ // but the fact that it returns a clause makes it hard since we don't control the patterns...
165
+ // we can make each clause return a format that can be extrapolated and used in codegen...
163
166
  function getObjectLoaderProperties(value, tableName) {
164
167
  return {
165
168
  clause: () => getTransformedReadClause(value),
@@ -463,6 +463,9 @@ class TempDB {
463
463
  async afterAll() {
464
464
  if (this.dialect === db_1.Dialect.SQLite) {
465
465
  this.sqlite.close();
466
+ if (!this.sqlite.memory) {
467
+ fs.rmSync(this.getSqliteClient().name);
468
+ }
466
469
  return;
467
470
  }
468
471
  // end our connection to db
@@ -554,7 +557,6 @@ function setupSqlite(connString, tables, opts) {
554
557
  }
555
558
  afterAll(async () => {
556
559
  await tdb.afterAll();
557
- fs.rmSync(tdb.getSqliteClient().name);
558
560
  delete process.env.DB_CONNECTION_STRING;
559
561
  });
560
562
  return tdb;