go-sqlite3 icon indicating copy to clipboard operation
go-sqlite3 copied to clipboard

userauth: don't register no-op auth functions and unify public API

Open charlievieth opened this issue 1 year ago • 4 comments

This commit changes Open to not register any of the auth functions when userauth is disabled. It also unifies the public API of this library for when userauth is enabled/disabled.

NOTE: This PR builds on and includes https://github.com/mattn/go-sqlite3/pull/1302

goos: darwin
goarch: arm64
pkg: github.com/charlievieth/go-sqlite3
cpu: Apple M4 Pro
                       │   y1.txt    │               y3.txt                │
                       │   sec/op    │   sec/op     vs base                │
Suite/BenchmarkOpen-14   13.76µ ± 1%   12.37µ ± 1%  -10.11% (p=0.000 n=10)

                       │   y1.txt   │               y3.txt               │
                       │    B/op    │    B/op     vs base                │
Suite/BenchmarkOpen-14   712.0 ± 0%   111.0 ± 1%  -84.41% (p=0.000 n=10)

                       │   y1.txt    │               y3.txt               │
                       │  allocs/op  │ allocs/op   vs base                │
Suite/BenchmarkOpen-14   20.000 ± 0%   3.000 ± 0%  -85.00% (p=0.000 n=10)

charlievieth avatar Dec 18 '24 01:12 charlievieth

@mattn / @rittneje could either of you take a look at https://github.com/mattn/go-sqlite3/pull/1302 and this PR? This PR depends on https://github.com/mattn/go-sqlite3/pull/1302.

charlievieth avatar Jan 13 '25 03:01 charlievieth

Looks good to me. @rittneje What do you think?

mattn avatar Apr 01 '25 13:04 mattn

@mattn I think #1302 is supposed to go first, as these changes include those changes.

rittneje avatar Apr 05 '25 19:04 rittneje

@mattn I think https://github.com/mattn/go-sqlite3/pull/1302 is supposed to go first, as these changes include those changes.

Correct, we should ideally merge https://github.com/mattn/go-sqlite3/pull/1302 before this PR (it's not strictly necessary since this PR contains the commit https://github.com/mattn/go-sqlite3/pull/1308/commits/83213c4e1a9696d43e32eac967f776b50d54ed41 from PR but for the sake of documentation and having commits tied to GH PRs it would probably best to merge that one first).

Thank you both for taking the time to review this!

charlievieth avatar Apr 08 '25 17:04 charlievieth