summaryrefslogtreecommitdiff
path: root/vendor/modernc.org/sqlite/sqlite.go
diff options
context:
space:
mode:
authorLibravatar dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>2023-06-12 11:25:23 +0200
committerLibravatar GitHub <noreply@github.com>2023-06-12 11:25:23 +0200
commit5d19fb1b2f70e499dd53f948bdc6d1505a9d33b1 (patch)
tree8a3dd8f9267b1643bdc2592dd7fdda8899aa9092 /vendor/modernc.org/sqlite/sqlite.go
parent[bugfix] Invalidate timeline entries for status when stats change (#1879) (diff)
downloadgotosocial-5d19fb1b2f70e499dd53f948bdc6d1505a9d33b1.tar.xz
[chore]: Bump modernc.org/sqlite from 1.23.0 to 1.23.1 (#1884)
Bumps [modernc.org/sqlite](https://gitlab.com/cznic/sqlite) from 1.23.0 to 1.23.1. - [Commits](https://gitlab.com/cznic/sqlite/compare/v1.23.0...v1.23.1) --- updated-dependencies: - dependency-name: modernc.org/sqlite dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Diffstat (limited to 'vendor/modernc.org/sqlite/sqlite.go')
-rw-r--r--vendor/modernc.org/sqlite/sqlite.go26
1 files changed, 26 insertions, 0 deletions
diff --git a/vendor/modernc.org/sqlite/sqlite.go b/vendor/modernc.org/sqlite/sqlite.go
index 4dd876f80..6968da820 100644
--- a/vendor/modernc.org/sqlite/sqlite.go
+++ b/vendor/modernc.org/sqlite/sqlite.go
@@ -2066,3 +2066,29 @@ func finalTrampoline(tls *libc.TLS, ctx uintptr) {
delete(xAggregateContext.m, id)
xAggregateContext.ids.reclaim(id)
}
+
+// int sqlite3_limit(sqlite3*, int id, int newVal);
+func (c *conn) limit(id int, newVal int) int {
+ return int(sqlite3.Xsqlite3_limit(c.tls, c.db, int32(id), int32(newVal)))
+}
+
+// Limit calls sqlite3_limit, see the docs at
+// https://www.sqlite.org/c3ref/limit.html for details.
+//
+// To get a sql.Conn from a *sql.DB, use (*sql.DB).Conn(). Limits are bound to
+// the particular instance of 'c', so getting a new connection only to pass it
+// to Limit is possibly not useful above querying what are the various
+// configured default values.
+func Limit(c *sql.Conn, id int, newVal int) (r int, err error) {
+ err = c.Raw(func(driverConn any) error {
+ switch dc := driverConn.(type) {
+ case *conn:
+ r = dc.limit(id, newVal)
+ return nil
+ default:
+ return fmt.Errorf("unexpected driverConn type: %T", driverConn)
+ }
+ })
+ return r, err
+
+}