Skip to content

Commit

Permalink
Implemented timestamp and datetime
Browse files Browse the repository at this point in the history
  • Loading branch information
maneesht committed Sep 23, 2024
1 parent c18d53a commit 5bcf9e7
Show file tree
Hide file tree
Showing 25 changed files with 1,943 additions and 433 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"etags": {},
"dataconnectEmulatorConfig": {
"postgres": {
"localConnectionString": "postgresql://postgres:postgres@localhost:5432/postgres?sslmode=disable"
"localConnectionString": "postgresql://postgres:secretpassword@localhost:5432/postgres?sslmode=disable"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ extend type Movie {
extend type Person {
id: UUID! @default(expr: "uuidV4()") @fdc_generated(from: "Person", purpose: IMPLICIT_KEY_FIELD)
}
extend type TimestampHolder {
id: UUID! @default(expr: "uuidV4()") @fdc_generated(from: "TimestampHolder", purpose: IMPLICIT_KEY_FIELD)
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
scalar DirectedBy_Key
scalar Movie_Key
scalar Person_Key
scalar TimestampHolder_Key
input DirectedBy_Data {
movieId: UUID
movieId_expr: UUID_Expr
Expand Down Expand Up @@ -88,3 +89,30 @@ input Person_Order {
id: OrderDirection
name: OrderDirection
}
input TimestampHolder_Data {
id: UUID
id_expr: UUID_Expr
date: Date
date_date: Date_Relative
date_expr: Date_Expr
timestamp: Timestamp
timestamp_expr: Timestamp_Expr
timestamp_time: Timestamp_Relative
}
input TimestampHolder_Filter {
_and: [TimestampHolder_Filter!]
_not: TimestampHolder_Filter
_or: [TimestampHolder_Filter!]
id: UUID_Filter
date: Date_Filter
timestamp: Timestamp_Filter
}
input TimestampHolder_ListFilter {
count: Int_Filter = {gt:0}
exist: TimestampHolder_Filter
}
input TimestampHolder_Order {
id: OrderDirection
date: OrderDirection
timestamp: OrderDirection
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ extend type Mutation {
"""
person_insert(data: Person_Data!): Person_Key! @fdc_generated(from: "Person", purpose: INSERT_SINGLE)
"""
Insert a single TimestampHolder into the table. Columns not specified in `data` will receive defaults (e.g. `null`).
"""
timestampHolder_insert(data: TimestampHolder_Data!): TimestampHolder_Key! @fdc_generated(from: "TimestampHolder", purpose: INSERT_SINGLE)
"""
Insert DirectedBy entries into the table. Columns not specified in `data` will receive defaults (e.g. `null`).
"""
directedBy_insertMany(data: [DirectedBy_Data!]!): [DirectedBy_Key!]! @fdc_generated(from: "DirectedBy", purpose: INSERT_MULTIPLE)
Expand All @@ -24,6 +28,10 @@ extend type Mutation {
"""
person_insertMany(data: [Person_Data!]!): [Person_Key!]! @fdc_generated(from: "Person", purpose: INSERT_MULTIPLE)
"""
Insert TimestampHolder entries into the table. Columns not specified in `data` will receive defaults (e.g. `null`).
"""
timestampHolder_insertMany(data: [TimestampHolder_Data!]!): [TimestampHolder_Key!]! @fdc_generated(from: "TimestampHolder", purpose: INSERT_MULTIPLE)
"""
Insert or update a single DirectedBy into the table, based on the primary key. Returns the key of the newly inserted DirectedBy.
"""
directedBy_upsert(data: DirectedBy_Data!): DirectedBy_Key! @fdc_generated(from: "DirectedBy", purpose: UPSERT_SINGLE)
Expand All @@ -36,6 +44,10 @@ extend type Mutation {
"""
person_upsert(data: Person_Data!): Person_Key! @fdc_generated(from: "Person", purpose: UPSERT_SINGLE)
"""
Insert or update a single TimestampHolder into the table, based on the primary key. Returns the key of the newly inserted TimestampHolder.
"""
timestampHolder_upsert(data: TimestampHolder_Data!): TimestampHolder_Key! @fdc_generated(from: "TimestampHolder", purpose: UPSERT_SINGLE)
"""
Insert or update DirectedBy entries into the table, based on the primary key. Returns the key of the newly inserted DirectedBy.
"""
directedBy_upsertMany(data: [DirectedBy_Data!]): [DirectedBy_Key!]! @fdc_generated(from: "DirectedBy", purpose: UPSERT_MULTIPLE)
Expand All @@ -48,6 +60,10 @@ extend type Mutation {
"""
person_upsertMany(data: [Person_Data!]): [Person_Key!]! @fdc_generated(from: "Person", purpose: UPSERT_MULTIPLE)
"""
Insert or update TimestampHolder entries into the table, based on the primary key. Returns the key of the newly inserted TimestampHolder.
"""
timestampHolder_upsertMany(data: [TimestampHolder_Data!]): [TimestampHolder_Key!]! @fdc_generated(from: "TimestampHolder", purpose: UPSERT_MULTIPLE)
"""
Update a single DirectedBy based on `id` or `key`, setting columns specified in `data`. Returns `null` if not found.
"""
directedBy_update(key: DirectedBy_Key, data: DirectedBy_Data!): DirectedBy_Key @fdc_generated(from: "DirectedBy", purpose: UPDATE_SINGLE)
Expand All @@ -60,6 +76,10 @@ extend type Mutation {
"""
person_update(id: UUID, key: Person_Key, data: Person_Data!): Person_Key @fdc_generated(from: "Person", purpose: UPDATE_SINGLE)
"""
Update a single TimestampHolder based on `id` or `key`, setting columns specified in `data`. Returns `null` if not found.
"""
timestampHolder_update(id: UUID, key: TimestampHolder_Key, data: TimestampHolder_Data!): TimestampHolder_Key @fdc_generated(from: "TimestampHolder", purpose: UPDATE_SINGLE)
"""
Update DirectedBy entries matching `where` conditions (or `all`, if true) according to `data`. Returns the number of rows updated.
"""
directedBy_updateMany(where: DirectedBy_Filter, all: Boolean = false, data: DirectedBy_Data!): Int! @fdc_generated(from: "DirectedBy", purpose: UPDATE_MULTIPLE)
Expand All @@ -72,6 +92,10 @@ extend type Mutation {
"""
person_updateMany(where: Person_Filter, all: Boolean = false, data: Person_Data!): Int! @fdc_generated(from: "Person", purpose: UPDATE_MULTIPLE)
"""
Update TimestampHolder entries matching `where` conditions (or `all`, if true) according to `data`. Returns the number of rows updated.
"""
timestampHolder_updateMany(where: TimestampHolder_Filter, all: Boolean = false, data: TimestampHolder_Data!): Int! @fdc_generated(from: "TimestampHolder", purpose: UPDATE_MULTIPLE)
"""
Delete a single DirectedBy based on `id` or `key` and return its key (or `null` if not found).
"""
directedBy_delete(key: DirectedBy_Key): DirectedBy_Key @fdc_generated(from: "DirectedBy", purpose: DELETE_SINGLE)
Expand All @@ -84,6 +108,10 @@ extend type Mutation {
"""
person_delete(id: UUID, key: Person_Key): Person_Key @fdc_generated(from: "Person", purpose: DELETE_SINGLE)
"""
Delete a single TimestampHolder based on `id` or `key` and return its key (or `null` if not found).
"""
timestampHolder_delete(id: UUID, key: TimestampHolder_Key): TimestampHolder_Key @fdc_generated(from: "TimestampHolder", purpose: DELETE_SINGLE)
"""
Delete DirectedBy entries matching `where` conditions (or `all`, if true). Returns the number of rows deleted.
"""
directedBy_deleteMany(where: DirectedBy_Filter, all: Boolean = false): Int! @fdc_generated(from: "DirectedBy", purpose: DELETE_MULTIPLE)
Expand All @@ -95,4 +123,8 @@ extend type Mutation {
Delete Person entries matching `where` conditions (or `all`, if true). Returns the number of rows deleted.
"""
person_deleteMany(where: Person_Filter, all: Boolean = false): Int! @fdc_generated(from: "Person", purpose: DELETE_MULTIPLE)
"""
Delete TimestampHolder entries matching `where` conditions (or `all`, if true). Returns the number of rows deleted.
"""
timestampHolder_deleteMany(where: TimestampHolder_Filter, all: Boolean = false): Int! @fdc_generated(from: "TimestampHolder", purpose: DELETE_MULTIPLE)
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ extend type Query {
"""
person(id: UUID, key: Person_Key): Person @fdc_generated(from: "Person", purpose: QUERY_SINGLE)
"""
Look up a single TimestampHolder based on `id` or `key` and return selected fields (or `null` if not found).
"""
timestampHolder(id: UUID, key: TimestampHolder_Key): TimestampHolder @fdc_generated(from: "TimestampHolder", purpose: QUERY_SINGLE)
"""
List DirectedBy entries in the table, optionally filtered by `where` conditions.
"""
directedBies(where: DirectedBy_Filter, orderBy: [DirectedBy_Order!], offset: Int, limit: Int = 100): [DirectedBy!]! @fdc_generated(from: "DirectedBy", purpose: QUERY_MULTIPLE)
Expand All @@ -23,4 +27,8 @@ extend type Query {
List Person entries in the table, optionally filtered by `where` conditions.
"""
people(where: Person_Filter, orderBy: [Person_Order!], offset: Int, limit: Int = 100): [Person!]! @fdc_generated(from: "Person", purpose: QUERY_MULTIPLE)
"""
List TimestampHolder entries in the table, optionally filtered by `where` conditions.
"""
timestampHolders(where: TimestampHolder_Filter, orderBy: [TimestampHolder_Order!], offset: Int, limit: Int = 100): [TimestampHolder!]! @fdc_generated(from: "TimestampHolder", purpose: QUERY_MULTIPLE)
}
Loading

0 comments on commit 5bcf9e7

Please sign in to comment.