On demand collations.

This commit is contained in:
Nuno Cruces
2024-09-27 15:45:51 +01:00
parent b4b50fc547
commit 167025f47a
3 changed files with 66 additions and 2 deletions

View File

@@ -33,7 +33,11 @@ func (c *Conn) CollationNeeded(cb func(db *Conn, name string)) error {
// one or more unknown collating sequences.
func (c Conn) AnyCollationNeeded() error {
r := c.call("sqlite3_anycollseq_init", uint64(c.handle), 0, 0)
return c.error(r)
if err := c.error(r); err != nil {
return err
}
c.collation = nil
return nil
}
// CreateCollation defines a new collating sequence.