Hello,
After re-reading the docs on serializability and the linearized
endpoint, it’s no longer clear to me in FQLv10 when a transaction becomes considered read-write vs read only.
Given the following example, which is true:
- Since the query contains a potential path to become a write transaction, it is always read-write OR
- The query will only be read-write if it goes down the conditional path that contains the write.
result = fauna_client.query(
fql(
"""
// query the document by name using the `byName` index.
let existing_doc = MyCollection.byName(${name})
if (existing_doc != null) {
existing_doc
} else {
MyCollection.create({name: ${name}})
}
""",
name=name
)
)