From dce6b34a8948550b00752d5f13071acd6280786f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20Sonck?= Date: Tue, 9 Dec 2025 11:49:51 +0100 Subject: [PATCH] Add percentile extension --- README.md | 1 + sqlite3_opt_percentile.go | 15 +++++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 sqlite3_opt_percentile.go diff --git a/README.md b/README.md index 76f49ba..5c4dd54 100644 --- a/README.md +++ b/README.md @@ -174,6 +174,7 @@ go build -tags "icu json1 fts5 secure_delete" | JSON SQL Functions | sqlite_json | When this option is defined in the amalgamation, the JSON SQL functions are added to the build automatically | | Math Functions | sqlite_math_functions | This compile-time option enables built-in scalar math functions. For more information see [Built-In Mathematical SQL Functions](https://www.sqlite.org/lang_mathfunc.html) | | OS Trace | sqlite_os_trace | This option enables OSTRACE() debug logging. This can be verbose and should not be used in production. | +| Percentile | sqlite_percentile | This option enables [The Percentile Extension](sqlite.org/percentile.html). | | Pre Update Hook | sqlite_preupdate_hook | Registers a callback function that is invoked prior to each INSERT, UPDATE, and DELETE operation on a database table. | | Secure Delete | sqlite_secure_delete | This compile-time option changes the default setting of the secure_delete pragma.

When this option is not used, secure_delete defaults to off. When this option is present, secure_delete defaults to on.

The secure_delete setting causes deleted content to be overwritten with zeros. There is a small performance penalty since additional I/O must occur.

On the other hand, secure_delete can prevent fragments of sensitive information from lingering in unused parts of the database file after it has been deleted. See the documentation on the secure_delete pragma for additional information | | Secure Delete (FAST) | sqlite_secure_delete_fast | For more information see [PRAGMA secure_delete](https://www.sqlite.org/pragma.html#pragma_secure_delete) | diff --git a/sqlite3_opt_percentile.go b/sqlite3_opt_percentile.go new file mode 100644 index 0000000..3461d9a --- /dev/null +++ b/sqlite3_opt_percentile.go @@ -0,0 +1,15 @@ +// Copyright (C) 2019 Yasuhiro Matsumoto . +// Copyright (C) 2018 G.J.R. Timmer . +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file. + +//go:build sqlite_percentile +// +build sqlite_percentile + +package sqlite3 + +/* +#cgo CFLAGS: -DSQLITE_ENABLE_PERCENTILE +*/ +import "C"