Skip to content

Commit

Permalink
Implemented: filterQualifier: true should be in the examples for all …
Browse files Browse the repository at this point in the history
…relation ids #96
  • Loading branch information
rizen committed Apr 10, 2024
1 parent 4c188ac commit 7a1fef9
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
3 changes: 3 additions & 0 deletions docs/change-log.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ outline: deep
---
# Change Log

## 2024-04-10
* Implemented: filterQualifier: true should be in the examples for all relation ids #96

## 2024-04-09
* Fixed: no type int example in ving schema #82
* Fixed: record delete generator not generating correctly #81
Expand Down
7 changes: 6 additions & 1 deletion docs/subsystems/ving-schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ The `type` field determines how the prop will react to data it is given. Below y
name: 'admin',
required: true,
default: false,
filterQualifier: true,
db: (prop) => dbBoolean(prop),
enums: [false, true],
enumLabels: ['Not Admin', 'Admin'],
Expand All @@ -86,7 +87,6 @@ The `type` field determines how the prop will react to data it is given. Below y
type: "int",
name: "sizeInBytes",
filterRange: true,
filterQualifier: true,
required: false,
default: 0,
db: (prop) => dbInt(prop),
Expand All @@ -102,6 +102,7 @@ The `type` field determines how the prop will react to data it is given. Below y
type: "date",
name: "startAt",
required: true,
filterRange: true,
default: () => new Date(),
db: (prop) => dbDateTime(prop),
view: ['public'],
Expand All @@ -116,6 +117,7 @@ The `type` field determines how the prop will react to data it is given. Below y
name: 'useAsDisplayName',
required: true,
length: 20,
filterQualifier: true,
default: 'username',
db: (prop) => dbEnum(prop),
enums: ['username', 'email', 'realName'],
Expand All @@ -133,6 +135,7 @@ These are used to add a parent relationship.
name: 'userId',
required: true,
length: 36,
filterQualifier: true,
db: (prop) => dbRelation(prop),
relation: {
type: 'parent',
Expand All @@ -154,6 +157,7 @@ These are used to add a parent relationship.
required: true,
unique: true,
length: 256,
filterQuery: true,
default: '',
db: (prop) => dbString(prop),
zod: (prop) => zodString(prop).email(),
Expand Down Expand Up @@ -185,6 +189,7 @@ These are used to add a parent relationship.
name: "memo",
required: true,
length: 256,
filterQuery: true,
default: '',
db: (prop) => dbText(prop),
zod: (prop) => zodText(prop),
Expand Down
8 changes: 8 additions & 0 deletions ving/generator/vingschema.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export const ${camelCase(name)}Schema = {
unique: true,
length: 256,
default: '',
filterQuery: true,
db: (prop) => dbString(prop),
zod: (prop) => zodString(prop).email(),
view: [],
Expand All @@ -42,6 +43,7 @@ export const ${camelCase(name)}Schema = {
required: true,
length: 60,
default: '',
filterQuery: true,
db: (prop) => dbString(prop),
zod: (prop) => zodString(prop),
view: [],
Expand All @@ -65,6 +67,7 @@ export const ${camelCase(name)}Schema = {
name: 'size',
required: true,
length: 20,
filterQualifier: true,
default: 'medium',
db: (prop) => dbEnum(prop),
enums: ['small', 'medium', 'large'],
Expand All @@ -78,6 +81,7 @@ export const ${camelCase(name)}Schema = {
name: "sizeInBytes",
required: false,
default: 0,
filterRange: true,
db: (prop) => dbInt(prop),
zod: (prop) => zodNumber(prop).positive(),
view: ['public'],
Expand All @@ -100,6 +104,7 @@ export const ${camelCase(name)}Schema = {
name: 'isCool',
required: true,
default: false,
filterQualifier: true,
db: (prop) => dbBoolean(prop),
enums: [false, true],
enumLabels: ['Not Cool', 'Very Cool'],
Expand All @@ -125,6 +130,7 @@ export const ${camelCase(name)}Schema = {
name: '${camelCase(name)}GroupId', // the name of the remote record's id in this table
required: true,
length: 36,
filterQualifier: true,
db: (prop) => dbRelation(prop),
relation: {
type: 'parent',
Expand All @@ -141,6 +147,7 @@ export const ${camelCase(name)}Schema = {
name: 'userId',
required: true,
length: 36,
filterQualifier: true,
db: (prop) => dbRelation(prop),
relation: {
type: 'parent',
Expand All @@ -156,6 +163,7 @@ export const ${camelCase(name)}Schema = {
type: "date",
name: "startedAt",
required: true,
filterRange: true,
default: () => new Date(),
db: (prop) => dbDateTime(prop),
view: ['public'],
Expand Down

0 comments on commit 7a1fef9

Please sign in to comment.