Replace Unsafe with Strict mechanism

Previously by default the presence of a missing field in
a udt would result in an error reported. The Unsafe
mechanism could be used to ignore these fields.

This PR changes the default behavior to ignoring missing
fields and only reporting an error if Strict mode is used.
This approach is in line with the gocql.
This commit is contained in:
sylwiaszunejko
2024-06-25 13:34:50 +02:00
committed by Sylwia Szunejko
parent 6a60650668
commit 7072863b0c
6 changed files with 69 additions and 70 deletions

View File

@@ -51,7 +51,7 @@ func (s Session) ContextQuery(ctx context.Context, stmt string, names []string)
Names: names,
Mapper: s.Mapper,
tr: DefaultBindTransformer,
unsafe: DefaultUnsafe,
strict: DefaultStrict,
}
}
@@ -66,7 +66,7 @@ func (s Session) Query(stmt string, names []string) *Queryx {
Names: names,
Mapper: s.Mapper,
tr: DefaultBindTransformer,
unsafe: DefaultUnsafe,
strict: DefaultStrict,
}
}