|
|
|
@ -178,7 +178,7 @@ impl<'a> SessionTx<'a> {
|
|
|
|
|
key_bindings,
|
|
|
|
|
*span,
|
|
|
|
|
)?,
|
|
|
|
|
RelationOp::Create | RelationOp::Replace | RelationOp::Put => self.put_into_relation(
|
|
|
|
|
RelationOp::Create | RelationOp::Replace | RelationOp::Put | RelationOp::Insert => self.put_into_relation(
|
|
|
|
|
db,
|
|
|
|
|
res_iter,
|
|
|
|
|
headers,
|
|
|
|
@ -191,6 +191,7 @@ impl<'a> SessionTx<'a> {
|
|
|
|
|
metadata,
|
|
|
|
|
key_bindings,
|
|
|
|
|
dep_bindings,
|
|
|
|
|
op == RelationOp::Insert,
|
|
|
|
|
*span,
|
|
|
|
|
)?,
|
|
|
|
|
};
|
|
|
|
@ -212,6 +213,7 @@ impl<'a> SessionTx<'a> {
|
|
|
|
|
metadata: &StoredRelationMetadata,
|
|
|
|
|
key_bindings: &[Symbol],
|
|
|
|
|
dep_bindings: &[Symbol],
|
|
|
|
|
is_insert: bool,
|
|
|
|
|
span: SourceSpan,
|
|
|
|
|
) -> Result<()> {
|
|
|
|
|
let is_callback_target = callback_targets.contains(&relation_store.name);
|
|
|
|
@ -268,6 +270,16 @@ impl<'a> SessionTx<'a> {
|
|
|
|
|
.map(|ex| ex.extract_data(&tuple, cur_vld))
|
|
|
|
|
.try_collect()?;
|
|
|
|
|
|
|
|
|
|
if is_insert {
|
|
|
|
|
if relation_store.exists(self, &extracted[..relation_store.metadata.keys.len()])? {
|
|
|
|
|
bail!(TransactAssertionFailure {
|
|
|
|
|
relation: relation_store.name.to_string(),
|
|
|
|
|
key: extracted,
|
|
|
|
|
notice: "key exists in database".to_string()
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let key = relation_store.encode_key_for_store(&extracted, span)?;
|
|
|
|
|
let val = relation_store.encode_val_for_store(&extracted, span)?;
|
|
|
|
|
|
|
|
|
|