You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: cassandra_storageType.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -55,7 +55,7 @@ Cassandra, due to its distributed nature does _not_ implement traditional limit-
55
55
Cassandra _only_ supports the sorting of the results from a query by specifically defining this via the [compound primary key](https://docs.datastax.com/en/cql-oss/3.3/cql/cql_using/useCompoundPrimaryKeyConcept.html) and the definition of a column by which to partition the data. Since zendro, for now, doen't implement those kind of primary keys, _no_ sorting of cassandra results is possible. The default is defined by cassandras internal [`token`](https://docs.datastax.com/en/cql-oss/3.3/cql/cql_using/useToken.html) function.
56
56
57
57
### Associations
58
-
Associations with the `targetStoragetType` set to Cassandra have some restrictions on searching. Since the association is resolved via adding a search for either `eq` to the respective foreignkey or `in` the foreignkey array in case the association is of type `many_to_many`. Cassandra does not allow multiple Equal restrictions on the id field, the driver will throw an Error. To circumvent that a workaround where searches on the idField are merged with the search on the foreignkey(s) is implemented.
58
+
Associations with the `targetStorageType` set to Cassandra have some restrictions on searching. Since the association is resolved via adding a search for either `eq` to the respective foreignkey or `in` the foreignkey array in case the association is of type `many_to_many`. Cassandra does not allow multiple Equal restrictions on the id field, the driver will throw an Error. To circumvent that a workaround where searches on the idField are merged with the search on the foreignkey(s) is implemented.
59
59
60
60
Be aware that the workaround only works because cassandra does _not_ support the OR operator. There are also the following pitfalls to consider:
61
61
- cassandra does not allow SELECT queries on indexed columns with IN clause for the PRIMARY KEY.
Copy file name to clipboardExpand all lines: setup_data_scheme.md
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -75,7 +75,7 @@ name | Type | Description
75
75
------- | ------- | --------------
76
76
*type* | String | Type of association, either `one_to_one`, `one_to_many`, `many_to_one`, or `many_to_many`.
77
77
*target* | String | Name of model to which the current model will be associated with.
78
-
*implementation* | String | implementation type of the association. Can be one of `foreignkey`, `generic` or `sql_cross_table` (only for `many_to_many`)
78
+
*implementation* | String | implementation type of the association. Can be one of `foreignkeys`, `generic` or `sql_cross_table` (only for `many_to_many`)
79
79
*reverseAssociation* | String | The name of the reverse association from the other model. This field is only mandatory for building the [single-page-app](https://github.com/Zendro-dev/single-page-app), *not* for generating the the graphql-server code via this repository.
80
80
*targetStorageType* | String | Type of storage where the target model is stored.
81
81
*useDataLoader* | Boolean | If it is set to `true`, server could fetch multiple records within one query for `readOne<model>` API.
@@ -108,7 +108,7 @@ Examples:
108
108
"associations":{
109
109
"publisher" : {
110
110
"type" : "many_to_one", // association type
111
-
"implementation": "foreignkey",
111
+
"implementation": "foreignkeys",
112
112
"reverseAssociation": "books",
113
113
"target" : "publisher", // the target model name is `publisher`
114
114
"targetKey" : "publisher_id", // foreign key for this association
@@ -130,7 +130,7 @@ Examples:
130
130
"associations":{
131
131
"books" : {
132
132
"type" : "one_to_many", // association type
133
-
"implementation": "foreignkey",
133
+
"implementation": "foreignkeys",
134
134
"reverseAssociation": "publisher",
135
135
"target" : "book", // the target model name is `book`
136
136
"targetKey" : "publisher_id", // foreign key for this association
@@ -144,7 +144,7 @@ Examples:
144
144
Storing the association via paired-end foreign keys means that both associated data-models contain a reference (foreign key) to the associated records. Storing the keys in that way guarantees read and search efficiency, especially in a distributed context, at the cost of time and storage-space when handling write actions. Since the keys are stored at both ends the information needs to be updated at both ends as well, which is slower and more prone to errors.
145
145
146
146
Many-to-many associations can be stored via paired-end associations. In this case both models will hold an array attribute which will store ids from the associated records. These two attributes will be described in the association as `sourceKey` and `targetKey`.
147
-
Also, for indicating that the association is a many-to-many association via arrays as foreign key, we need to specify in the association info the `implementation` field as `foreignkey`.
147
+
Also, for indicating that the association is a many-to-many association via arrays as foreign key, we need to specify in the association info the `implementation` field as `foreignkeys`.
148
148
149
149
To define paired-end foreign key associations the following arguments need to be added:
150
150
@@ -174,7 +174,7 @@ Assume we have an many_to_many association between two models `book` and `author
174
174
"associations":{
175
175
"books":{
176
176
"type": "many_to_many", // association type
177
-
"implementation": "foreignkey",
177
+
"implementation": "foreignkeys",
178
178
"reverseAssociation": "authors",
179
179
"target": "book", // target model name
180
180
"targetKey": "author_ids", // foreign key array stored in target model
@@ -184,7 +184,7 @@ Assume we have an many_to_many association between two models `book` and `author
184
184
},
185
185
"cards":{
186
186
"type": "one_to_many", // association type
187
-
"implementation": "foreignkey",
187
+
"implementation": "foreignkeys",
188
188
"reverseAssociation": "author",
189
189
"target": "card", // target model name
190
190
"targetKey": "author_id", // foreign key stored in target model
@@ -214,7 +214,7 @@ Assume we have an many_to_many association between two models `book` and `author
214
214
"associations":{
215
215
"authors":{
216
216
"type": "many_to_many", // association type
217
-
"implementation": "foreignkey",
217
+
"implementation": "foreignkeys",
218
218
"reverseAssociation": "books",
219
219
"target": "author", // target model name
220
220
"targetKey": "book_ids", // foreign key array stored in target model
@@ -241,7 +241,7 @@ Assume we have an many_to_many association between two models `book` and `author
241
241
"associations":{
242
242
"author":{
243
243
"type": "many_to_one", // association type
244
-
"implementation": "foreignkey",
244
+
"implementation": "foreignkeys",
245
245
"reverseAssociation": "cards",
246
246
"target": "author", // target model name
247
247
"targetKey": "card_ids", // foreign key array stored in target model
0 commit comments