Full Code of mattn/go-sqlite3 for AI

master 0d2388125f1e cached
96 files
10.0 MB
2.6M tokens
5789 symbols
1 requests
Copy disabled (too large) Download .txt
Showing preview only (10,530K chars total). Download the full file to get everything.
Repository: mattn/go-sqlite3
Branch: master
Commit: 0d2388125f1e
Files: 96
Total size: 10.0 MB

Directory structure:
gitextract_57o27kni/

├── .codecov.yml
├── .github/
│   ├── FUNDING.yml
│   └── workflows/
│       ├── cifuzz.yaml
│       ├── docker.yaml
│       └── go.yaml
├── .gitignore
├── LICENSE
├── README.md
├── _example/
│   ├── custom_driver_name/
│   │   ├── Makefile
│   │   └── main.go
│   ├── custom_func/
│   │   └── main.go
│   ├── fuzz/
│   │   └── fuzz_openexec.go
│   ├── hook/
│   │   └── hook.go
│   ├── json/
│   │   └── json.go
│   ├── limit/
│   │   └── limit.go
│   ├── mod_regexp/
│   │   ├── Makefile
│   │   ├── extension.go
│   │   └── sqlite3_mod_regexp.c
│   ├── mod_vtable/
│   │   ├── Makefile
│   │   ├── extension.go
│   │   ├── picojson.h
│   │   └── sqlite3_mod_vtable.cc
│   ├── simple/
│   │   ├── Dockerfile
│   │   └── simple.go
│   ├── trace/
│   │   └── main.go
│   ├── vtable/
│   │   ├── main.go
│   │   └── vtable.go
│   └── vtable_eponymous_only/
│       ├── main.go
│       └── vtable.go
├── backup.go
├── backup_test.go
├── callback.go
├── callback_test.go
├── convert.go
├── doc.go
├── error.go
├── error_test.go
├── go.mod
├── go.sum
├── sqlite3-binding.c
├── sqlite3-binding.h
├── sqlite3.go
├── sqlite3_context.go
├── sqlite3_func_crypt.go
├── sqlite3_func_crypt_test.go
├── sqlite3_go113_test.go
├── sqlite3_go18.go
├── sqlite3_go18_test.go
├── sqlite3_libsqlite3.go
├── sqlite3_load_extension.go
├── sqlite3_load_extension_omit.go
├── sqlite3_load_extension_test.go
├── sqlite3_opt_allow_uri_authority.go
├── sqlite3_opt_app_armor.go
├── sqlite3_opt_column_metadata.go
├── sqlite3_opt_column_metadata_test.go
├── sqlite3_opt_foreign_keys.go
├── sqlite3_opt_fts3_test.go
├── sqlite3_opt_fts5.go
├── sqlite3_opt_icu.go
├── sqlite3_opt_introspect.go
├── sqlite3_opt_math_functions.go
├── sqlite3_opt_math_functions_test.go
├── sqlite3_opt_os_trace.go
├── sqlite3_opt_percentile.go
├── sqlite3_opt_preupdate.go
├── sqlite3_opt_preupdate_hook.go
├── sqlite3_opt_preupdate_hook_test.go
├── sqlite3_opt_preupdate_omit.go
├── sqlite3_opt_secure_delete.go
├── sqlite3_opt_secure_delete_fast.go
├── sqlite3_opt_serialize.go
├── sqlite3_opt_serialize_omit.go
├── sqlite3_opt_serialize_test.go
├── sqlite3_opt_stat4.go
├── sqlite3_opt_unlock_notify.c
├── sqlite3_opt_unlock_notify.go
├── sqlite3_opt_unlock_notify_test.go
├── sqlite3_opt_userauth.go
├── sqlite3_opt_userauth_omit.go
├── sqlite3_opt_userauth_test.go
├── sqlite3_opt_vacuum_full.go
├── sqlite3_opt_vacuum_incr.go
├── sqlite3_opt_vtable.go
├── sqlite3_opt_vtable_test.go
├── sqlite3_other.go
├── sqlite3_solaris.go
├── sqlite3_test.go
├── sqlite3_trace.go
├── sqlite3_type.go
├── sqlite3_usleep_windows.go
├── sqlite3_windows.go
├── sqlite3ext.h
├── static_mock.go
└── upgrade/
    ├── upgrade.go
    └── upgrade.sh

================================================
FILE CONTENTS
================================================

================================================
FILE: .codecov.yml
================================================
coverage:
  status:
    project: off
    patch: off


================================================
FILE: .github/FUNDING.yml
================================================
# These are supported funding model platforms

github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: mattn # Replace with a single Patreon username
open_collective: mattn # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
custom: # Replace with a single custom sponsorship URL


================================================
FILE: .github/workflows/cifuzz.yaml
================================================
name: CIFuzz
on: [pull_request]
jobs:
 Fuzzing:
   runs-on: ubuntu-latest
   strategy:
     fail-fast: false
     matrix:
       sanitizer: [address]
   steps:
   - name: Build Fuzzers (${{ matrix.sanitizer }})
     uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master
     with:
       oss-fuzz-project-name: 'go-sqlite3'
       dry-run: false
       sanitizer: ${{ matrix.sanitizer }}
   - name: Run Fuzzers (${{ matrix.sanitizer }})
     uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master
     with:
       oss-fuzz-project-name: 'go-sqlite3'
       fuzz-seconds: 600
       dry-run: false
       sanitizer: ${{ matrix.sanitizer }}
   - name: Upload Crash
     uses: actions/upload-artifact@v4
     if: failure()
     with:
       name: ${{ matrix.sanitizer }}-artifacts
       path: ./out/artifacts


================================================
FILE: .github/workflows/docker.yaml
================================================
name: dockerfile

on:
  workflow_dispatch:
  push:
    tags:
      - 'v*'
  pull_request:
    branches: [ master ]

jobs:
  dockerfile:
    name: Run Dockerfiles in examples
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v6

      - name: Run example - simple
        run: |
          docker build -t simple -f ./_example/simple/Dockerfile .
          docker run simple | grep 99\ こんにちは世界099


================================================
FILE: .github/workflows/go.yaml
================================================
name: Go

on: [push, pull_request]

jobs:

  test:
    name: Test
    runs-on: ${{ matrix.os }}
    defaults:
      run:
        shell: bash

    strategy:
      matrix:
        os: [ubuntu-latest, macos-latest]
        go: ['1.24', '1.25', '1.26']
      fail-fast: false
    env:
      OS: ${{ matrix.os }}
      GO: ${{ matrix.go }}
    steps:
      - if: startsWith(matrix.os, 'macos')
        run: brew update

      - uses: actions/setup-go@v6
        with:
          go-version: ${{ matrix.go }}

      - name: Get Build Tools
        run: |
          GO111MODULE=on go install github.com/ory/go-acc@latest

      - name: Add $GOPATH/bin to $PATH
        run: |
          echo "$(go env GOPATH)/bin" >> "$GITHUB_PATH"

      - uses: actions/checkout@v6

      - name: 'Tags: default'
        run: go-acc . -- -race -v -tags ""

      - name: 'Tags: libsqlite3'
        run: go-acc . -- -race -v -tags "libsqlite3"

      - name: 'Tags: full'
        run: go-acc . -- -race -v -tags "sqlite_allow_uri_authority sqlite_app_armor sqlite_column_metadata sqlite_foreign_keys sqlite_fts5 sqlite_icu sqlite_introspect sqlite_json sqlite_math_functions sqlite_os_trace sqlite_preupdate_hook sqlite_secure_delete sqlite_see sqlite_stat4 sqlite_trace sqlite_unlock_notify sqlite_vacuum_incr sqlite_vtable"

      - name: 'Tags: vacuum'
        run: go-acc . -- -race -v -tags "sqlite_vacuum_full"

      - name: Upload coverage to Codecov
        uses: codecov/codecov-action@v5
        with:
          env_vars: OS,GO
          file: coverage.txt

  test-windows:
    name: Test for Windows
    runs-on: windows-latest
    defaults:
      run:
        shell: bash

    strategy:
      matrix:
        go: ['1.24', '1.25', '1.26']
      fail-fast: false
    env:
      OS: windows-latest
      GO: ${{ matrix.go }}
    steps:
      - uses: msys2/setup-msys2@v2
        with:
          update: true
          install: mingw-w64-x86_64-toolchain mingw-w64-x86_64-sqlite3
          msystem: MINGW64
          path-type: inherit

      - uses: actions/setup-go@v6
        with:
          go-version: ${{ matrix.go }}

      - name: Add $GOPATH/bin to $PATH
        run: |
          echo "$(go env GOPATH)/bin" >> "$GITHUB_PATH"
        shell: msys2 {0}

      - uses: actions/checkout@v6

      - name: 'Tags: default'
        run: go build -race -v -tags ""
        shell: msys2 {0}

      - name: 'Tags: libsqlite3'
        run: go build -race -v -tags "libsqlite3"
        shell: msys2 {0}

      - name: 'Tags: full'
        run: |
          echo 'skip this test'
          echo go build -race -v -tags "sqlite_allow_uri_authority sqlite_app_armor sqlite_column_metadata sqlite_foreign_keys sqlite_fts5 sqlite_icu sqlite_introspect sqlite_json sqlite_math_functions sqlite_preupdate_hook sqlite_secure_delete sqlite_see sqlite_stat4 sqlite_trace sqlite_unlock_notify sqlite_vacuum_incr sqlite_vtable"
        shell: msys2 {0}

      - name: 'Tags: vacuum'
        run: go build -race -v -tags "sqlite_vacuum_full"
        shell: msys2 {0}

      - name: Upload coverage to Codecov
        uses: codecov/codecov-action@v5
        with:
          env_vars: OS,GO
          file: coverage.txt

# based on: github.com/koron-go/_skeleton/.github/workflows/go.yml


================================================
FILE: .gitignore
================================================
*.db
*.exe
*.dll
*.o

# VSCode
.vscode

# Exclude from upgrade
upgrade/*.c
upgrade/*.h

# Exclude upgrade binary
upgrade/upgrade


================================================
FILE: LICENSE
================================================
The MIT License (MIT)

Copyright (c) 2014 Yasuhiro Matsumoto

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.


================================================
FILE: README.md
================================================
go-sqlite3
==========

[![Go Reference](https://pkg.go.dev/badge/github.com/mattn/go-sqlite3.svg)](https://pkg.go.dev/github.com/mattn/go-sqlite3)
[![GitHub Actions](https://github.com/mattn/go-sqlite3/workflows/Go/badge.svg)](https://github.com/mattn/go-sqlite3/actions?query=workflow%3AGo)
[![Financial Contributors on Open Collective](https://opencollective.com/mattn-go-sqlite3/all/badge.svg?label=financial+contributors)](https://opencollective.com/mattn-go-sqlite3) 
[![codecov](https://codecov.io/gh/mattn/go-sqlite3/branch/master/graph/badge.svg)](https://codecov.io/gh/mattn/go-sqlite3)
[![Go Report Card](https://goreportcard.com/badge/github.com/mattn/go-sqlite3)](https://goreportcard.com/report/github.com/mattn/go-sqlite3)

Latest stable version is v1.14 or later, not v2.

~~**NOTE:** The increase to v2 was an accident. There were no major changes or features.~~

# Description

A sqlite3 driver that conforms to the built-in database/sql interface.

Supported Golang version: See [.github/workflows/go.yaml](./.github/workflows/go.yaml).

This package follows the official [Golang Release Policy](https://golang.org/doc/devel/release.html#policy).

### Overview

- [go-sqlite3](#go-sqlite3)
- [Description](#description)
    - [Overview](#overview)
- [Installation](#installation)
- [API Reference](#api-reference)
- [Connection String](#connection-string)
  - [DSN Examples](#dsn-examples)
- [Features](#features)
    - [Usage](#usage)
    - [Feature / Extension List](#feature--extension-list)
- [Compilation](#compilation)
  - [Android](#android)
- [ARM](#arm)
- [Cross Compile](#cross-compile)
- [Compiling](#compiling)
  - [Linux](#linux)
    - [Alpine](#alpine)
    - [Fedora](#fedora)
    - [Ubuntu](#ubuntu)
  - [macOS](#mac-osx)
  - [Windows](#windows)
  - [Errors](#errors)
- [User Authentication](#user-authentication)
  - [Compile](#compile)
  - [Usage](#usage-1)
    - [Create protected database](#create-protected-database)
    - [Password Encoding](#password-encoding)
      - [Available Encoders](#available-encoders)
    - [Restrictions](#restrictions)
    - [Support](#support)
    - [User Management](#user-management)
      - [SQL](#sql)
        - [Examples](#examples)
      - [*SQLiteConn](#sqliteconn)
    - [Attached database](#attached-database)
- [Extensions](#extensions)
  - [Spatialite](#spatialite)
- [FAQ](#faq)
- [License](#license)
- [Author](#author)

# Installation

This package can be installed with the `go get` command:

    go get github.com/mattn/go-sqlite3

_go-sqlite3_ is *cgo* package.
If you want to build your app using go-sqlite3, you need gcc.

***Important: because this is a `CGO` enabled package, you are required to set the environment variable `CGO_ENABLED=1` and have a `gcc` compiler present within your path.***

# API Reference

API documentation can be found [here](http://godoc.org/github.com/mattn/go-sqlite3).

Examples can be found under the [examples](./_example) directory.

# Connection String

When creating a new SQLite database or connection to an existing one, with the file name additional options can be given.
This is also known as a DSN (Data Source Name) string.

Options are append after the filename of the SQLite database.
The database filename and options are separated by an `?` (Question Mark).
Options should be URL-encoded (see [url.QueryEscape](https://golang.org/pkg/net/url/#QueryEscape)).

This also applies when using an in-memory database instead of a file.

Options can be given using the following format: `KEYWORD=VALUE` and multiple options can be combined with the `&` ampersand.

This library supports DSN options of SQLite itself and provides additional options.

Boolean values can be one of:
* `0` `no` `false` `off`
* `1` `yes` `true` `on`

| Name | Key | Value(s) | Description |
|------|-----|----------|-------------|
| UA - Create | `_auth` | - | Create User Authentication, for more information see [User Authentication](#user-authentication) |
| UA - Username | `_auth_user` | `string` | Username for User Authentication, for more information see [User Authentication](#user-authentication) |
| UA - Password | `_auth_pass` | `string` | Password for User Authentication, for more information see [User Authentication](#user-authentication) |
| UA - Crypt | `_auth_crypt` | <ul><li>SHA1</li><li>SSHA1</li><li>SHA256</li><li>SSHA256</li><li>SHA384</li><li>SSHA384</li><li>SHA512</li><li>SSHA512</li></ul> | Password encoder to use for User Authentication, for more information see [User Authentication](#user-authentication) |
| UA - Salt | `_auth_salt` | `string` | Salt to use if the configure password encoder requires a salt, for User Authentication, for more information see [User Authentication](#user-authentication) |
| Auto Vacuum | `_auto_vacuum` \| `_vacuum` | <ul><li>`0` \| `none`</li><li>`1` \| `full`</li><li>`2` \| `incremental`</li></ul> | For more information see [PRAGMA auto_vacuum](https://www.sqlite.org/pragma.html#pragma_auto_vacuum) |
| Busy Timeout | `_busy_timeout` \| `_timeout` | `int` | Specify value for sqlite3_busy_timeout. For more information see [PRAGMA busy_timeout](https://www.sqlite.org/pragma.html#pragma_busy_timeout) |
| Case Sensitive LIKE | `_case_sensitive_like` \| `_cslike` | `boolean` | For more information see [PRAGMA case_sensitive_like](https://www.sqlite.org/pragma.html#pragma_case_sensitive_like) |
| Defer Foreign Keys | `_defer_foreign_keys` \| `_defer_fk` | `boolean` | For more information see [PRAGMA defer_foreign_keys](https://www.sqlite.org/pragma.html#pragma_defer_foreign_keys) |
| Foreign Keys | `_foreign_keys` \| `_fk` | `boolean` | For more information see [PRAGMA foreign_keys](https://www.sqlite.org/pragma.html#pragma_foreign_keys) |
| Ignore CHECK Constraints | `_ignore_check_constraints` | `boolean` | For more information see [PRAGMA ignore_check_constraints](https://www.sqlite.org/pragma.html#pragma_ignore_check_constraints) |
| Immutable | `immutable` | `boolean` | For more information see [Immutable](https://www.sqlite.org/c3ref/open.html) |
| Journal Mode | `_journal_mode` \| `_journal` | <ul><li>DELETE</li><li>TRUNCATE</li><li>PERSIST</li><li>MEMORY</li><li>WAL</li><li>OFF</li></ul> | For more information see [PRAGMA journal_mode](https://www.sqlite.org/pragma.html#pragma_journal_mode) |
| Locking Mode | `_locking_mode` \| `_locking` | <ul><li>NORMAL</li><li>EXCLUSIVE</li></ul> | For more information see [PRAGMA locking_mode](https://www.sqlite.org/pragma.html#pragma_locking_mode) |
| Mode | `mode` | <ul><li>ro</li><li>rw</li><li>rwc</li><li>memory</li></ul> | Access Mode of the database. For more information see [SQLite Open](https://www.sqlite.org/c3ref/open.html) |
| Mutex Locking | `_mutex` | <ul><li>no</li><li>full</li></ul> | Specify mutex mode. |
| Query Only | `_query_only` | `boolean` | For more information see [PRAGMA query_only](https://www.sqlite.org/pragma.html#pragma_query_only) |
| Recursive Triggers | `_recursive_triggers` \| `_rt` | `boolean` | For more information see [PRAGMA recursive_triggers](https://www.sqlite.org/pragma.html#pragma_recursive_triggers) |
| Secure Delete | `_secure_delete` | `boolean` \| `FAST` | For more information see [PRAGMA secure_delete](https://www.sqlite.org/pragma.html#pragma_secure_delete) |
| Shared-Cache Mode | `cache` | <ul><li>shared</li><li>private</li></ul> | Set cache mode for more information see [sqlite.org](https://www.sqlite.org/sharedcache.html) |
| Synchronous | `_synchronous` \| `_sync` | <ul><li>0 \| OFF</li><li>1 \| NORMAL</li><li>2 \| FULL</li><li>3 \| EXTRA</li></ul> | For more information see [PRAGMA synchronous](https://www.sqlite.org/pragma.html#pragma_synchronous) |
| Time Zone Location | `_loc` | auto | Specify location of time format. |
| Transaction Lock | `_txlock` | <ul><li>immediate</li><li>deferred</li><li>exclusive</li></ul> | Specify locking behavior for transactions. |
| Writable Schema | `_writable_schema` | `Boolean` | When this pragma is on, the SQLITE_MASTER tables in which database can be changed using ordinary UPDATE, INSERT, and DELETE statements. Warning: misuse of this pragma can easily result in a corrupt database file. |
| Cache Size | `_cache_size` | `int` | Maximum cache size; default is 2000K (2M). See [PRAGMA cache_size](https://sqlite.org/pragma.html#pragma_cache_size) |


## DSN Examples

```
file:test.db?cache=shared&mode=memory
```

# Features

This package allows additional configuration of features available within SQLite3 to be enabled or disabled by golang build constraints also known as build `tags`.

Click [here](https://golang.org/pkg/go/build/#hdr-Build_Constraints) for more information about build tags / constraints.

### Usage

If you wish to build this library with additional extensions / features, use the following command:

```bash
go build -tags "<FEATURE>"
```

For available features, see the extension list.
When using multiple build tags, all the different tags should be space delimited.

Example:

```bash
go build -tags "icu json1 fts5 secure_delete"
```

### Feature / Extension List

| Extension | Build Tag | Description |
|-----------|-----------|-------------|
| Additional Statistics | sqlite_stat4 | This option adds additional logic to the ANALYZE command and to the query planner that can help SQLite to chose a better query plan under certain situations. The ANALYZE command is enhanced to collect histogram data from all columns of every index and store that data in the sqlite_stat4 table.<br><br>The query planner will then use the histogram data to help it make better index choices. The downside of this compile-time option is that it violates the query planner stability guarantee making it more difficult to ensure consistent performance in mass-produced applications.<br><br>SQLITE_ENABLE_STAT4 is an enhancement of SQLITE_ENABLE_STAT3. STAT3 only recorded histogram data for the left-most column of each index whereas the STAT4 enhancement records histogram data from all columns of each index.<br><br>The SQLITE_ENABLE_STAT3 compile-time option is a no-op and is ignored if the SQLITE_ENABLE_STAT4 compile-time option is used |
| Allow URI Authority | sqlite_allow_uri_authority | URI filenames normally throws an error if the authority section is not either empty or "localhost".<br><br>However, if SQLite is compiled with the SQLITE_ALLOW_URI_AUTHORITY compile-time option, then the URI is converted into a Uniform Naming Convention (UNC) filename and passed down to the underlying operating system that way |
| App Armor | sqlite_app_armor | When defined, this C-preprocessor macro activates extra code that attempts to detect misuse of the SQLite API, such as passing in NULL pointers to required parameters or using objects after they have been destroyed. <br><br>App Armor is not available under `Windows`. |
| Disable Load Extensions | sqlite_omit_load_extension | Loading of external extensions is enabled by default.<br><br>To disable extension loading add the build tag `sqlite_omit_load_extension`. |
| Enable Serialization with `libsqlite3` | sqlite_serialize | Serialization and deserialization of a SQLite database is available by default, unless the build tag `libsqlite3` is set.<br><br>To enable this functionality even if `libsqlite3` is set, add the build tag `sqlite_serialize`. |
| Foreign Keys | sqlite_foreign_keys | This macro determines whether enforcement of foreign key constraints is enabled or disabled by default for new database connections.<br><br>Each database connection can always turn enforcement of foreign key constraints on and off and run-time using the foreign_keys pragma.<br><br>Enforcement of foreign key constraints is normally off by default, but if this compile-time parameter is set to 1, enforcement of foreign key constraints will be on by default | 
| Full Auto Vacuum | sqlite_vacuum_full | Set the default auto vacuum to full |
| Incremental Auto Vacuum | sqlite_vacuum_incr | Set the default auto vacuum to incremental |
| Full Text Search Engine | sqlite_fts5 | When this option is defined in the amalgamation, versions 5 of the full-text search engine (fts5) is added to the build automatically |
|  International Components for Unicode | sqlite_icu | This option causes the International Components for Unicode or "ICU" extension to SQLite to be added to the build |
| Introspect PRAGMAS | sqlite_introspect | This option adds some extra PRAGMA statements. <ul><li>PRAGMA function_list</li><li>PRAGMA module_list</li><li>PRAGMA pragma_list</li></ul> |
| 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.<br><br>When this option is not used, secure_delete defaults to off. When this option is present, secure_delete defaults to on.<br><br>The secure_delete setting causes deleted content to be overwritten with zeros. There is a small performance penalty since additional I/O must occur.<br><br>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) |
| Tracing / Debug | sqlite_trace | Activate trace functions |
| User Authentication | sqlite_userauth | SQLite User Authentication see [User Authentication](#user-authentication) for more information. |
| Virtual Tables | sqlite_vtable | SQLite Virtual Tables see [SQLite Official VTABLE Documentation](https://www.sqlite.org/vtab.html) for more information, and a [full example here](https://github.com/mattn/go-sqlite3/tree/master/_example/vtable) |

# Compilation

This package requires the `CGO_ENABLED=1` environment variable if not set by default, and the presence of the `gcc` compiler.

If you need to add additional CFLAGS or LDFLAGS to the build command, and do not want to modify this package, then this can be achieved by using the `CGO_CFLAGS` and `CGO_LDFLAGS` environment variables.

## Android

This package can be compiled for android.
Compile with:

```bash
go build -tags "android"
```

For more information see [#201](https://github.com/mattn/go-sqlite3/issues/201)

# ARM

To compile for `ARM` use the following environment:

```bash
env CC=arm-linux-gnueabihf-gcc CXX=arm-linux-gnueabihf-g++ \
    CGO_ENABLED=1 GOOS=linux GOARCH=arm GOARM=7 \
    go build -v 
```

Additional information:
- [#242](https://github.com/mattn/go-sqlite3/issues/242)
- [#504](https://github.com/mattn/go-sqlite3/issues/504)

# Cross Compile

This library can be cross-compiled.

In some cases you are required to the `CC` environment variable with the cross compiler.

## Cross Compiling from macOS
The simplest way to cross compile from macOS is to use [xgo](https://github.com/karalabe/xgo).

Steps:
- Install [musl-cross](https://github.com/FiloSottile/homebrew-musl-cross) (`brew install FiloSottile/musl-cross/musl-cross`).
- Run `CC=x86_64-linux-musl-gcc CXX=x86_64-linux-musl-g++ GOARCH=amd64 GOOS=linux CGO_ENABLED=1 go build -ldflags "-linkmode external -extldflags -static"`.

Please refer to the project's [README](https://github.com/FiloSottile/homebrew-musl-cross#readme) for further information.

# Compiling

## Linux

To compile this package on Linux, you must install the development tools for your linux distribution.

To compile under linux use the build tag `linux`.

```bash
go build -tags "linux"
```

If you wish to link directly to libsqlite3 then you can use the `libsqlite3` build tag.

```
go build -tags "libsqlite3 linux"
```

### Alpine

When building in an `alpine` container  run the following command before building:

```
apk add --update gcc musl-dev
```

### Fedora

```bash
sudo yum groupinstall "Development Tools" "Development Libraries"
```

### Ubuntu

```bash
sudo apt-get install build-essential
```

## macOS

macOS should have all the tools present to compile this package. If not, install XCode to add all the developers tools.

Required dependency:

```bash
brew install sqlite3
```

For macOS, there is an additional package to install which is required if you wish to build the `icu` extension.

This additional package can be installed with `homebrew`:

```bash
brew upgrade icu4c
```

To compile for macOS on x86:

```bash
go build -tags "darwin amd64"
```

To compile for macOS on ARM chips:

```bash
go build -tags "darwin arm64"
```

If you wish to link directly to libsqlite3, use the `libsqlite3` build tag:

```
# x86 
go build -tags "libsqlite3 darwin amd64"
# ARM
go build -tags "libsqlite3 darwin arm64"
```

Additional information:
- [#206](https://github.com/mattn/go-sqlite3/issues/206)
- [#404](https://github.com/mattn/go-sqlite3/issues/404)

## Windows

To compile this package on Windows, you must have the `gcc` compiler installed.

1) Install a Windows `gcc` toolchain.
2) Add the `bin` folder to the Windows path, if the installer did not do this by default.
3) Open a terminal for the TDM-GCC toolchain, which can be found in the Windows Start menu.
4) Navigate to your project folder and run the `go build ...` command for this package.

For example the TDM-GCC Toolchain can be found [here](https://jmeubank.github.io/tdm-gcc/).

## Errors

- Compile error: `can not be used when making a shared object; recompile with -fPIC`

    When receiving a compile time error referencing recompile with `-FPIC` then you
    are probably using a hardend system.

    You can compile the library on a hardend system with the following command.

    ```bash
    go build -ldflags '-extldflags=-fno-PIC'
    ```

    More details see [#120](https://github.com/mattn/go-sqlite3/issues/120)

- Can't build go-sqlite3 on windows 64bit.

    > Probably, you are using go 1.0, go1.0 has a problem when it comes to compiling/linking on windows 64bit.
    > See: [#27](https://github.com/mattn/go-sqlite3/issues/27)

- `go get github.com/mattn/go-sqlite3` throws compilation error.

    `gcc` throws: `internal compiler error`

    Remove the download repository from your disk and try re-install with:

    ```bash
    go install github.com/mattn/go-sqlite3
    ```

# User Authentication

***This is deprecated***

This package supports the SQLite User Authentication module.

## Compile

To use the User authentication module, the package has to be compiled with the tag `sqlite_userauth`. See [Features](#features).

## Usage

### Create protected database

To create a database protected by user authentication, provide the following argument to the connection string `_auth`.
This will enable user authentication within the database. This option however requires two additional arguments:

- `_auth_user`
- `_auth_pass`

When `_auth` is present in the connection string user authentication will be enabled and the provided user will be created
as an `admin` user. After initial creation, the parameter `_auth` has no effect anymore and can be omitted from the connection string.

Example connection strings:

Create an user authentication database with user `admin` and password `admin`:

`file:test.s3db?_auth&_auth_user=admin&_auth_pass=admin`

Create an user authentication database with user `admin` and password `admin` and use `SHA1` for the password encoding:

`file:test.s3db?_auth&_auth_user=admin&_auth_pass=admin&_auth_crypt=sha1`

### Password Encoding

The passwords within the user authentication module of SQLite are encoded with the SQLite function `sqlite_cryp`.
This function uses a ceasar-cypher which is quite insecure.
This library provides several additional password encoders which can be configured through the connection string.

The password cypher can be configured with the key `_auth_crypt`. And if the configured password encoder also requires an
salt this can be configured with `_auth_salt`.

#### Available Encoders

- SHA1
- SSHA1 (Salted SHA1)
- SHA256
- SSHA256 (salted SHA256)
- SHA384
- SSHA384 (salted SHA384)
- SHA512
- SSHA512 (salted SHA512)

### Restrictions

Operations on the database regarding user management can only be preformed by an administrator user.

### Support

The user authentication supports two kinds of users:

- administrators
- regular users

### User Management

User management can be done by directly using the `*SQLiteConn` or by SQL.

#### SQL

The following sql functions are available for user management:

| Function | Arguments | Description |
|----------|-----------|-------------|
| `authenticate` | username `string`, password `string` | Will authenticate an user, this is done by the connection; and should not be used manually. |
| `auth_user_add` | username `string`, password `string`, admin `int` | This function will add an user to the database.<br>if the database is not protected by user authentication it will enable it. Argument `admin` is an integer identifying if the added user should be an administrator. Only Administrators can add administrators. |
| `auth_user_change` | username `string`, password `string`, admin `int` | Function to modify an user. Users can change their own password, but only an administrator can change the administrator flag. |
| `authUserDelete` | username `string` | Delete an user from the database. Can only be used by an administrator. The current logged in administrator cannot be deleted. This is to make sure their is always an administrator remaining. |

These functions will return an integer:

- 0 (SQLITE_OK)
- 23 (SQLITE_AUTH) Failed to perform due to authentication or insufficient privileges

##### Examples

```sql
// Autheticate user
// Create Admin User
SELECT auth_user_add('admin2', 'admin2', 1);

// Change password for user
SELECT auth_user_change('user', 'userpassword', 0);

// Delete user
SELECT user_delete('user');
```

#### *SQLiteConn

The following functions are available for User authentication from the `*SQLiteConn`:

| Function | Description |
|----------|-------------|
| `Authenticate(username, password string) error` | Authenticate user |
| `AuthUserAdd(username, password string, admin bool) error` | Add user |
| `AuthUserChange(username, password string, admin bool) error` | Modify user |
| `AuthUserDelete(username string) error` | Delete user |

### Attached database

When using attached databases, SQLite will use the authentication from the `main` database for the attached database(s).

# Extensions

If you want your own extension to be listed here, or you want to add a reference to an extension; please submit an Issue for this.

## Spatialite

Spatialite is available as an extension to SQLite, and can be used in combination with this repository.
For an example, see [shaxbee/go-spatialite](https://github.com/shaxbee/go-spatialite).

## extension-functions.c from SQLite3 Contrib

extension-functions.c is available as an extension to SQLite, and provides the following functions:

- Math: acos, asin, atan, atn2, atan2, acosh, asinh, atanh, difference, degrees, radians, cos, sin, tan, cot, cosh, sinh, tanh, coth, exp, log, log10, power, sign, sqrt, square, ceil, floor, pi.
- String: replicate, charindex, leftstr, rightstr, ltrim, rtrim, trim, replace, reverse, proper, padl, padr, padc, strfilter.
- Aggregate: stdev, variance, mode, median, lower_quartile, upper_quartile

For an example, see [dinedal/go-sqlite3-extension-functions](https://github.com/dinedal/go-sqlite3-extension-functions).

# FAQ

- Getting insert error while query is opened.

    > You can pass some arguments into the connection string, for example, a URI.
    > See: [#39](https://github.com/mattn/go-sqlite3/issues/39)

- Do you want to cross compile? mingw on Linux or Mac?

    > See: [#106](https://github.com/mattn/go-sqlite3/issues/106)
    > See also: http://www.limitlessfx.com/cross-compile-golang-app-for-windows-from-linux.html

- Want to get time.Time with current locale

    Use `_loc=auto` in SQLite3 filename schema like `file:foo.db?_loc=auto`.

- Can I use this in multiple routines concurrently?

    Yes for readonly. But not for writable. See [#50](https://github.com/mattn/go-sqlite3/issues/50), [#51](https://github.com/mattn/go-sqlite3/issues/51), [#209](https://github.com/mattn/go-sqlite3/issues/209), [#274](https://github.com/mattn/go-sqlite3/issues/274).

- Why I'm getting `no such table` error?

    Why is it racy if I use a `sql.Open("sqlite3", ":memory:")` database?

    Each connection to `":memory:"` opens a brand new in-memory sql database, so if
    the stdlib's sql engine happens to open another connection and you've only
    specified `":memory:"`, that connection will see a brand new database. A
    workaround is to use `"file::memory:?cache=shared"` (or `"file:foobar?mode=memory&cache=shared"`). Every
    connection to this string will point to the same in-memory database.
    
    Note that if the last database connection in the pool closes, the in-memory database is deleted. Make sure the [max idle connection limit](https://golang.org/pkg/database/sql/#DB.SetMaxIdleConns) is > 0, and the [connection lifetime](https://golang.org/pkg/database/sql/#DB.SetConnMaxLifetime) is infinite.
    
    For more information see:
    * [#204](https://github.com/mattn/go-sqlite3/issues/204)
    * [#511](https://github.com/mattn/go-sqlite3/issues/511)
    * https://www.sqlite.org/sharedcache.html#shared_cache_and_in_memory_databases
    * https://www.sqlite.org/inmemorydb.html#sharedmemdb

- Reading from database with large amount of goroutines fails on OSX.

    OS X limits OS-wide to not have more than 1000 files open simultaneously by default.

    For more information, see [#289](https://github.com/mattn/go-sqlite3/issues/289)

- Trying to execute a `.` (dot) command throws an error.

    Error: `Error: near ".": syntax error`
    Dot command are part of SQLite3 CLI, not of this library.

    You need to implement the feature or call the sqlite3 cli.

    More information see [#305](https://github.com/mattn/go-sqlite3/issues/305).

- Error: `database is locked`

    When you get a database is locked, please use the following options.

    Add to DSN: `cache=shared`

    Example:
    ```go
    db, err := sql.Open("sqlite3", "file:locked.sqlite?cache=shared")
    ```

    Next, please set the database connections of the SQL package to 1:
    
    ```go
    db.SetMaxOpenConns(1)
    ```

    For more information, see [#209](https://github.com/mattn/go-sqlite3/issues/209).

## Contributors

### Code Contributors

This project exists thanks to all the people who [[contribute](CONTRIBUTING.md)].
<a href="https://github.com/mattn/go-sqlite3/graphs/contributors"><img src="https://opencollective.com/mattn-go-sqlite3/contributors.svg?width=890&button=false" /></a>

### Financial Contributors

Become a financial contributor and help us sustain our community. [[Contribute here](https://opencollective.com/mattn-go-sqlite3/contribute)].

#### Individuals

<a href="https://opencollective.com/mattn-go-sqlite3"><img src="https://opencollective.com/mattn-go-sqlite3/individuals.svg?width=890"></a>

#### Organizations

Support this project with your organization. Your logo will show up here with a link to your website. [[Contribute](https://opencollective.com/mattn-go-sqlite3/contribute)]

<a href="https://opencollective.com/mattn-go-sqlite3/organization/0/website"><img src="https://opencollective.com/mattn-go-sqlite3/organization/0/avatar.svg"></a>
<a href="https://opencollective.com/mattn-go-sqlite3/organization/1/website"><img src="https://opencollective.com/mattn-go-sqlite3/organization/1/avatar.svg"></a>
<a href="https://opencollective.com/mattn-go-sqlite3/organization/2/website"><img src="https://opencollective.com/mattn-go-sqlite3/organization/2/avatar.svg"></a>
<a href="https://opencollective.com/mattn-go-sqlite3/organization/3/website"><img src="https://opencollective.com/mattn-go-sqlite3/organization/3/avatar.svg"></a>
<a href="https://opencollective.com/mattn-go-sqlite3/organization/4/website"><img src="https://opencollective.com/mattn-go-sqlite3/organization/4/avatar.svg"></a>
<a href="https://opencollective.com/mattn-go-sqlite3/organization/5/website"><img src="https://opencollective.com/mattn-go-sqlite3/organization/5/avatar.svg"></a>
<a href="https://opencollective.com/mattn-go-sqlite3/organization/6/website"><img src="https://opencollective.com/mattn-go-sqlite3/organization/6/avatar.svg"></a>
<a href="https://opencollective.com/mattn-go-sqlite3/organization/7/website"><img src="https://opencollective.com/mattn-go-sqlite3/organization/7/avatar.svg"></a>
<a href="https://opencollective.com/mattn-go-sqlite3/organization/8/website"><img src="https://opencollective.com/mattn-go-sqlite3/organization/8/avatar.svg"></a>
<a href="https://opencollective.com/mattn-go-sqlite3/organization/9/website"><img src="https://opencollective.com/mattn-go-sqlite3/organization/9/avatar.svg"></a>

# License

MIT: http://mattn.mit-license.org/2018

sqlite3-binding.c, sqlite3-binding.h, sqlite3ext.h

The -binding suffix was added to avoid build failures under gccgo.

In this repository, those files are an amalgamation of code that was copied from SQLite3. The license of that code is the same as the license of SQLite3.

# Author

Yasuhiro Matsumoto (a.k.a mattn)

G.J.R. Timmer


================================================
FILE: _example/custom_driver_name/Makefile
================================================
TARGET = custom_driver_name
ifeq ($(OS),Windows_NT)
TARGET := $(TARGET).exe
endif

all : $(TARGET)

$(TARGET) : main.go
	go build -ldflags="-X 'github.com/mattn/go-sqlite3.driverName=my-sqlite3'"

clean :
	rm -f $(TARGET)


================================================
FILE: _example/custom_driver_name/main.go
================================================
package main

import (
	"database/sql"

	_ "github.com/mattn/go-sqlite3"
)

func main() {
	for _, driver := range sql.Drivers() {
		println(driver)
	}
}


================================================
FILE: _example/custom_func/main.go
================================================
package main

import (
	"database/sql"
	"fmt"
	"log"
	"math"
	"math/rand"

	sqlite "github.com/mattn/go-sqlite3"
)

// Computes x^y
func pow(x, y int64) int64 {
	return int64(math.Pow(float64(x), float64(y)))
}

// Computes the bitwise exclusive-or of all its arguments
func xor(xs ...int64) int64 {
	var ret int64
	for _, x := range xs {
		ret ^= x
	}
	return ret
}

// Returns a random number. It's actually deterministic here because
// we don't seed the RNG, but it's an example of a non-pure function
// from SQLite's POV.
func getrand() int64 {
	return rand.Int63()
}

// Computes the standard deviation of a GROUPed BY set of values
type stddev struct {
	xs []int64
	// Running average calculation
	sum int64
	n   int64
}

func newStddev() *stddev { return &stddev{} }

func (s *stddev) Step(x int64) {
	s.xs = append(s.xs, x)
	s.sum += x
	s.n++
}

func (s *stddev) Done() float64 {
	mean := float64(s.sum) / float64(s.n)
	var sqDiff []float64
	for _, x := range s.xs {
		sqDiff = append(sqDiff, math.Pow(float64(x)-mean, 2))
	}
	var dev float64
	for _, x := range sqDiff {
		dev += x
	}
	dev /= float64(len(sqDiff))
	return math.Sqrt(dev)
}

func main() {
	sql.Register("sqlite3_custom", &sqlite.SQLiteDriver{
		ConnectHook: func(conn *sqlite.SQLiteConn) error {
			if err := conn.RegisterFunc("pow", pow, true); err != nil {
				return err
			}
			if err := conn.RegisterFunc("xor", xor, true); err != nil {
				return err
			}
			if err := conn.RegisterFunc("rand", getrand, false); err != nil {
				return err
			}
			if err := conn.RegisterAggregator("stddev", newStddev, true); err != nil {
				return err
			}
			return nil
		},
	})

	db, err := sql.Open("sqlite3_custom", ":memory:")
	if err != nil {
		log.Fatal("Failed to open database:", err)
	}
	defer db.Close()

	var i int64
	err = db.QueryRow("SELECT pow(2,3)").Scan(&i)
	if err != nil {
		log.Fatal("POW query error:", err)
	}
	fmt.Println("pow(2,3) =", i) // 8

	err = db.QueryRow("SELECT xor(1,2,3,4,5,6)").Scan(&i)
	if err != nil {
		log.Fatal("XOR query error:", err)
	}
	fmt.Println("xor(1,2,3,4,5) =", i) // 7

	err = db.QueryRow("SELECT rand()").Scan(&i)
	if err != nil {
		log.Fatal("RAND query error:", err)
	}
	fmt.Println("rand() =", i) // pseudorandom

	_, err = db.Exec("create table foo (department integer, profits integer)")
	if err != nil {
		log.Fatal("Failed to create table:", err)
	}
	_, err = db.Exec("insert into foo values (1, 10), (1, 20), (1, 45), (2, 42), (2, 115)")
	if err != nil {
		log.Fatal("Failed to insert records:", err)
	}

	rows, err := db.Query("select department, stddev(profits) from foo group by department")
	if err != nil {
		log.Fatal("STDDEV query error:", err)
	}
	defer rows.Close()
	for rows.Next() {
		var dept int64
		var dev float64
		if err := rows.Scan(&dept, &dev); err != nil {
			log.Fatal(err)
		}
		fmt.Printf("dept=%d stddev=%f\n", dept, dev)
	}
	if err := rows.Err(); err != nil {
		log.Fatal(err)
	}
}


================================================
FILE: _example/fuzz/fuzz_openexec.go
================================================
package sqlite3_fuzz

import (
	"bytes"
	"database/sql"
	"io/ioutil"

	_ "github.com/mattn/go-sqlite3"
)

func FuzzOpenExec(data []byte) int {
	sep := bytes.IndexByte(data, 0)
	if sep <= 0 {
		return 0
	}
	err := ioutil.WriteFile("/tmp/fuzz.db", data[sep+1:], 0644)
	if err != nil {
		return 0
	}
	db, err := sql.Open("sqlite3", "/tmp/fuzz.db")
	if err != nil {
		return 0
	}
	defer db.Close()
	_, err = db.Exec(string(data[:sep-1]))
	if err != nil {
		return 0
	}
	return 1
}


================================================
FILE: _example/hook/hook.go
================================================
package main

import (
	"database/sql"
	"log"
	"os"

	"github.com/mattn/go-sqlite3"
)

func main() {
	sqlite3conn := []*sqlite3.SQLiteConn{}
	sql.Register("sqlite3_with_hook_example",
		&sqlite3.SQLiteDriver{
			ConnectHook: func(conn *sqlite3.SQLiteConn) error {
				sqlite3conn = append(sqlite3conn, conn)
				conn.RegisterUpdateHook(func(op int, db string, table string, rowid int64) {
					switch op {
					case sqlite3.SQLITE_INSERT:
						log.Println("Notified of insert on db", db, "table", table, "rowid", rowid)
					}
				})
				return nil
			},
		})
	os.Remove("./foo.db")
	os.Remove("./bar.db")

	srcDb, err := sql.Open("sqlite3_with_hook_example", "./foo.db")
	if err != nil {
		log.Fatal(err)
	}
	defer srcDb.Close()
	srcDb.Ping()

	_, err = srcDb.Exec("create table foo(id int, value text)")
	if err != nil {
		log.Fatal(err)
	}
	_, err = srcDb.Exec("insert into foo values(1, 'foo')")
	if err != nil {
		log.Fatal(err)
	}
	_, err = srcDb.Exec("insert into foo values(2, 'bar')")
	if err != nil {
		log.Fatal(err)
	}
	_, err = srcDb.Query("select * from foo")
	if err != nil {
		log.Fatal(err)
	}
	destDb, err := sql.Open("sqlite3_with_hook_example", "./bar.db")
	if err != nil {
		log.Fatal(err)
	}
	defer destDb.Close()
	destDb.Ping()

	bk, err := sqlite3conn[1].Backup("main", sqlite3conn[0], "main")
	if err != nil {
		log.Fatal(err)
	}

	_, err = bk.Step(-1)
	if err != nil {
		log.Fatal(err)
	}
	_, err = destDb.Query("select * from foo")
	if err != nil {
		log.Fatal(err)
	}
	_, err = destDb.Exec("insert into foo values(3, 'bar')")
	if err != nil {
		log.Fatal(err)
	}

	bk.Finish()
}


================================================
FILE: _example/json/json.go
================================================
package main

import (
	"database/sql"
	"database/sql/driver"
	"encoding/json"
	"fmt"
	_ "github.com/mattn/go-sqlite3"
	"log"
	"os"
)

type Tag struct {
	Name    string `json:"name"`
	Country string `json:"country"`
}

func (t *Tag) Scan(value interface{}) error {
	return json.Unmarshal([]byte(value.(string)), t)
}

func (t *Tag) Value() (driver.Value, error) {
	b, err := json.Marshal(t)
	return string(b), err
}

func main() {
	os.Remove("./foo.db")

	db, err := sql.Open("sqlite3", "./foo.db")
	if err != nil {
		log.Fatal(err)
	}
	defer db.Close()

	// Using a json-typed column
	// Verify type: `create table foo (tag text) strict`
	_, err = db.Exec(`create table foo (tag json)`)
	if err != nil {
		log.Fatal(err)
	}

	stmt, err := db.Prepare("insert into foo(tag) values(?)")
	if err != nil {
		log.Fatal(err)
	}
	defer stmt.Close()
	_, err = stmt.Exec(`{"name": "mattn", "country": "japan"}`)
	if err != nil {
		log.Fatal(err)
	}
	_, err = stmt.Exec(`{"name": "michael", "country": "usa"}`)
	if err != nil {
		log.Fatal(err)
	}

	var country string
	err = db.QueryRow("select tag->>'country' from foo where tag->>'name' = 'mattn'").Scan(&country)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(country)

	var tag Tag
	err = db.QueryRow("select tag from foo where tag->>'name' = 'mattn'").Scan(&tag)
	if err != nil {
		log.Fatal(err)
	}

	fmt.Println(tag.Name)

	tag.Country = "日本"
	_, err = db.Exec(`update foo set tag = ? where tag->>'name' == 'mattn'`, &tag)
	if err != nil {
		log.Fatal(err)
	}

	err = db.QueryRow("select tag->>'country' from foo where tag->>'name' = 'mattn'").Scan(&country)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(country)

	// Using a jsonb-typed column
	// Verify type: `create table bar (tag blob) strict`
	_, err = db.Exec(`create table bar (tag jsonb)`)
	if err != nil {
		log.Fatal(err)
	}

	stmt, err = db.Prepare("insert into bar(tag) values(jsonb(?))")
	if err != nil {
		log.Fatal(err)
	}
	defer stmt.Close()
	_, err = stmt.Exec(`{"name": "mattn", "country": "japan"}`)
	if err != nil {
		log.Fatal(err)
	}
	_, err = stmt.Exec(`{"name": "michael", "country": "usa"}`)
	if err != nil {
		log.Fatal(err)
	}

	err = db.QueryRow("select tag->>'country' from bar where tag->>'name' = 'mattn'").Scan(&country)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(country)

	err = db.QueryRow("select json(tag) from bar where tag->>'name' = 'mattn'").Scan(&tag)
	if err != nil {
		log.Fatal(err)
	}

	fmt.Println(tag.Name)

	tag.Country = "日本"
	_, err = db.Exec(`update bar set tag = jsonb(?) where tag->>'name' == 'mattn'`, &tag)
	if err != nil {
		log.Fatal(err)
	}

	err = db.QueryRow("select tag->>'country' from bar where tag->>'name' = 'mattn'").Scan(&country)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(country)
}


================================================
FILE: _example/limit/limit.go
================================================
package main

import (
	"database/sql"
	"fmt"
	"log"
	"os"
	"strings"

	"github.com/mattn/go-sqlite3"
)

func createBulkInsertQuery(n int, start int) (query string, args []any) {
	values := make([]string, n)
	args = make([]any, n*2)
	pos := 0
	for i := 0; i < n; i++ {
		values[i] = "(?, ?)"
		args[pos] = start + i
		args[pos+1] = fmt.Sprintf("こんにちは世界%03d", i)
		pos += 2
	}
	query = fmt.Sprintf(
		"insert into foo(id, name) values %s",
		strings.Join(values, ", "),
	)
	return
}

func bulkInsert(db *sql.DB, query string, args []any) (err error) {
	stmt, err := db.Prepare(query)
	if err != nil {
		return
	}

	_, err = stmt.Exec(args...)
	if err != nil {
		return
	}

	return
}

func main() {
	var sqlite3conn *sqlite3.SQLiteConn
	sql.Register("sqlite3_with_limit", &sqlite3.SQLiteDriver{
		ConnectHook: func(conn *sqlite3.SQLiteConn) error {
			sqlite3conn = conn
			return nil
		},
	})

	os.Remove("./foo.db")
	db, err := sql.Open("sqlite3_with_limit", "./foo.db")
	if err != nil {
		log.Fatal(err)
	}
	defer db.Close()

	sqlStmt := `
	create table foo (id integer not null primary key, name text);
	delete from foo;
	`
	_, err = db.Exec(sqlStmt)
	if err != nil {
		log.Printf("%q: %s\n", err, sqlStmt)
		return
	}

	if sqlite3conn == nil {
		log.Fatal("not set sqlite3 connection")
	}

	limitVariableNumber := sqlite3conn.GetLimit(sqlite3.SQLITE_LIMIT_VARIABLE_NUMBER)
	log.Printf("default SQLITE_LIMIT_VARIABLE_NUMBER: %d", limitVariableNumber)

	num := 400
	query, args := createBulkInsertQuery(num, 0)
	err = bulkInsert(db, query, args)
	if err != nil {
		log.Fatal(err)
	}

	smallLimitVariableNumber := 100
	sqlite3conn.SetLimit(sqlite3.SQLITE_LIMIT_VARIABLE_NUMBER, smallLimitVariableNumber)

	limitVariableNumber = sqlite3conn.GetLimit(sqlite3.SQLITE_LIMIT_VARIABLE_NUMBER)
	log.Printf("updated SQLITE_LIMIT_VARIABLE_NUMBER: %d", limitVariableNumber)

	query, args = createBulkInsertQuery(num, num)
	err = bulkInsert(db, query, args)
	if err != nil {
		if err != nil {
			log.Printf("expect failed since SQLITE_LIMIT_VARIABLE_NUMBER is too small: %v", err)
		}
	}

	bigLimitVariableNumber := 999999
	sqlite3conn.SetLimit(sqlite3.SQLITE_LIMIT_VARIABLE_NUMBER, bigLimitVariableNumber)
	limitVariableNumber = sqlite3conn.GetLimit(sqlite3.SQLITE_LIMIT_VARIABLE_NUMBER)
	log.Printf("set SQLITE_LIMIT_VARIABLE_NUMBER: %d", bigLimitVariableNumber)
	log.Printf("updated SQLITE_LIMIT_VARIABLE_NUMBER: %d", limitVariableNumber)

	query, args = createBulkInsertQuery(500, num+num)
	err = bulkInsert(db, query, args)
	if err != nil {
		if err != nil {
			log.Fatal(err)
		}
	}

	log.Println("no error if SQLITE_LIMIT_VARIABLE_NUMBER > 999")
}


================================================
FILE: _example/mod_regexp/Makefile
================================================
ifeq ($(OS),Windows_NT)
EXE=extension.exe
LIB_EXT=dll
RM=cmd /c del
LDFLAG=
else
EXE=extension
ifeq ($(shell uname -s),Darwin)
LIB_EXT=dylib
else
LIB_EXT=so
endif
RM=rm -f
LDFLAG=-fPIC
endif
LIB=sqlite3_mod_regexp.$(LIB_EXT)

all : $(EXE) $(LIB)

$(EXE) : extension.go
	go build $<

$(LIB) : sqlite3_mod_regexp.c
	gcc $(LDFLAG) -shared -o $@ $< -lsqlite3 -lpcre

clean :
	@-$(RM) $(EXE) $(LIB)


================================================
FILE: _example/mod_regexp/extension.go
================================================
package main

import (
	"database/sql"
	"fmt"
	"github.com/mattn/go-sqlite3"
	"log"
)

func main() {
	sql.Register("sqlite3_with_extensions",
		&sqlite3.SQLiteDriver{
			Extensions: []string{
				"sqlite3_mod_regexp",
			},
		})

	db, err := sql.Open("sqlite3_with_extensions", ":memory:")
	if err != nil {
		log.Fatal(err)
	}
	defer db.Close()

	// Force db to make a new connection in pool
	// by putting the original in a transaction
	tx, err := db.Begin()
	if err != nil {
		log.Fatal(err)
	}
	defer tx.Commit()

	// New connection works (hopefully!)
	rows, err := db.Query("select 'hello world' where 'hello world' regexp '^hello.*d$'")
	if err != nil {
		log.Fatal(err)
	}
	defer rows.Close()
	for rows.Next() {
		var helloworld string
		rows.Scan(&helloworld)
		fmt.Println(helloworld)
	}
}


================================================
FILE: _example/mod_regexp/sqlite3_mod_regexp.c
================================================
#include <pcre.h>
#include <string.h>
#include <stdio.h>
#include <sqlite3ext.h>

SQLITE_EXTENSION_INIT1
static void regexp_func(sqlite3_context *context, int argc, sqlite3_value **argv) {
  if (argc >= 2) {
    const char *target  = (const char *)sqlite3_value_text(argv[1]);
    const char *pattern = (const char *)sqlite3_value_text(argv[0]);
    const char* errstr = NULL;
    int erroff = 0;
    int vec[500];
    int n, rc;
    pcre* re = pcre_compile(pattern, 0, &errstr, &erroff, NULL);
    if (!re) {
      sqlite3_result_error(context, errstr, 0);
      return;
    }
    rc = pcre_exec(re, NULL, target, strlen(target), 0, 0, vec, 500); 
    if (rc <= 0) {
      sqlite3_result_int(context, 0);
      return;
    }
    sqlite3_result_int(context, 1);
  }
}

#ifdef _WIN32
__declspec(dllexport)
#endif
int sqlite3_extension_init(sqlite3 *db, char **errmsg, const sqlite3_api_routines *api) {
  SQLITE_EXTENSION_INIT2(api);
  return sqlite3_create_function(db, "regexp", 2, SQLITE_UTF8, (void*)db, regexp_func, NULL, NULL);
}


================================================
FILE: _example/mod_vtable/Makefile
================================================
ifeq ($(OS),Windows_NT)
EXE=extension.exe
LIB_EXT=dll
RM=cmd /c del
LIBCURL=-lcurldll
LDFLAG=
else
EXE=extension
ifeq ($(shell uname -s),Darwin)
LIB_EXT=dylib
else
LIB_EXT=so
endif
RM=rm -f
LDFLAG=-fPIC
LIBCURL=-lcurl
endif
LIB=sqlite3_mod_vtable.$(LIB_EXT)

all : $(EXE) $(LIB)

$(EXE) : extension.go
	go build $<

$(LIB) : sqlite3_mod_vtable.cc
	g++ $(LDFLAG) -shared -o $@ $< -lsqlite3 $(LIBCURL)

clean :
	@-$(RM) $(EXE) $(LIB)


================================================
FILE: _example/mod_vtable/extension.go
================================================
package main

import (
	"database/sql"
	"fmt"
	"log"

	"github.com/mattn/go-sqlite3"
)

func main() {
	sql.Register("sqlite3_with_extensions",
		&sqlite3.SQLiteDriver{
			Extensions: []string{
				"sqlite3_mod_vtable",
			},
		})

	db, err := sql.Open("sqlite3_with_extensions", ":memory:")
	if err != nil {
		log.Fatal(err)
	}
	defer db.Close()

	db.Exec("create virtual table repo using github(id, full_name, description, html_url)")

	rows, err := db.Query("select id, full_name, description, html_url from repo")
	if err != nil {
		log.Fatal(err)
	}
	defer rows.Close()
	for rows.Next() {
		var id, fullName, description, htmlURL string
		rows.Scan(&id, &fullName, &description, &htmlURL)
		fmt.Printf("%s: %s\n\t%s\n\t%s\n\n", id, fullName, description, htmlURL)
	}
}


================================================
FILE: _example/mod_vtable/picojson.h
================================================
/*
 * Copyright 2009-2010 Cybozu Labs, Inc.
 * Copyright 2011 Kazuho Oku
 * 
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 * 
 * 1. Redistributions of source code must retain the above copyright notice,
 *    this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright notice,
 *    this list of conditions and the following disclaimer in the documentation
 *    and/or other materials provided with the distribution.
 * 
 * THIS SOFTWARE IS PROVIDED BY CYBOZU LABS, INC. ``AS IS'' AND ANY EXPRESS OR
 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
 * EVENT SHALL CYBOZU LABS, INC. OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 * 
 * The views and conclusions contained in the software and documentation are
 * those of the authors and should not be interpreted as representing official
 * policies, either expressed or implied, of Cybozu Labs, Inc.
 *
 */
#ifndef picojson_h
#define picojson_h

#include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <iterator>
#include <map>
#include <string>
#include <vector>

#ifdef _MSC_VER
    #define SNPRINTF _snprintf_s
    #pragma warning(push)
    #pragma warning(disable : 4244) // conversion from int to char
#else
    #define SNPRINTF snprintf
#endif

namespace picojson {
  
  enum {
    null_type,
    boolean_type,
    number_type,
    string_type,
    array_type,
    object_type
  };
  
  struct null {};
  
  class value {
  public:
    typedef std::vector<value> array;
    typedef std::map<std::string, value> object;
    union _storage {
      bool boolean_;
      double number_;
      std::string* string_;
      array* array_;
      object* object_;
    };
  protected:
    int type_;
    _storage u_;
  public:
    value();
    value(int type, bool);
    explicit value(bool b);
    explicit value(double n);
    explicit value(const std::string& s);
    explicit value(const array& a);
    explicit value(const object& o);
    explicit value(const char* s);
    value(const char* s, size_t len);
    ~value();
    value(const value& x);
    value& operator=(const value& x);
    void swap(value& x);
    template <typename T> bool is() const;
    template <typename T> const T& get() const;
    template <typename T> T& get();
    bool evaluate_as_boolean() const;
    const value& get(size_t idx) const;
    const value& get(const std::string& key) const;
    bool contains(size_t idx) const;
    bool contains(const std::string& key) const;
    std::string to_str() const;
    template <typename Iter> void serialize(Iter os) const;
    std::string serialize() const;
  private:
    template <typename T> value(const T*); // intentionally defined to block implicit conversion of pointer to bool
  };
  
  typedef value::array array;
  typedef value::object object;
  
  inline value::value() : type_(null_type) {}
  
  inline value::value(int type, bool) : type_(type) {
    switch (type) {
#define INIT(p, v) case p##type: u_.p = v; break
      INIT(boolean_, false);
      INIT(number_, 0.0);
      INIT(string_, new std::string());
      INIT(array_, new array());
      INIT(object_, new object());
#undef INIT
    default: break;
    }
  }
  
  inline value::value(bool b) : type_(boolean_type) {
    u_.boolean_ = b;
  }
  
  inline value::value(double n) : type_(number_type) {
    u_.number_ = n;
  }
  
  inline value::value(const std::string& s) : type_(string_type) {
    u_.string_ = new std::string(s);
  }
  
  inline value::value(const array& a) : type_(array_type) {
    u_.array_ = new array(a);
  }
  
  inline value::value(const object& o) : type_(object_type) {
    u_.object_ = new object(o);
  }
  
  inline value::value(const char* s) : type_(string_type) {
    u_.string_ = new std::string(s);
  }
  
  inline value::value(const char* s, size_t len) : type_(string_type) {
    u_.string_ = new std::string(s, len);
  }
  
  inline value::~value() {
    switch (type_) {
#define DEINIT(p) case p##type: delete u_.p; break
      DEINIT(string_);
      DEINIT(array_);
      DEINIT(object_);
#undef DEINIT
    default: break;
    }
  }
  
  inline value::value(const value& x) : type_(x.type_) {
    switch (type_) {
#define INIT(p, v) case p##type: u_.p = v; break
      INIT(string_, new std::string(*x.u_.string_));
      INIT(array_, new array(*x.u_.array_));
      INIT(object_, new object(*x.u_.object_));
#undef INIT
    default:
      u_ = x.u_;
      break;
    }
  }
  
  inline value& value::operator=(const value& x) {
    if (this != &x) {
      this->~value();
      new (this) value(x);
    }
    return *this;
  }
  
  inline void value::swap(value& x) {
    std::swap(type_, x.type_);
    std::swap(u_, x.u_);
  }
  
#define IS(ctype, jtype)			     \
  template <> inline bool value::is<ctype>() const { \
    return type_ == jtype##_type;		     \
  }
  IS(null, null)
  IS(bool, boolean)
  IS(int, number)
  IS(double, number)
  IS(std::string, string)
  IS(array, array)
  IS(object, object)
#undef IS
  
#define GET(ctype, var)						\
  template <> inline const ctype& value::get<ctype>() const {	\
    assert("type mismatch! call vis<type>() before get<type>()" \
	   && is<ctype>());				        \
    return var;							\
  }								\
  template <> inline ctype& value::get<ctype>() {		\
    assert("type mismatch! call is<type>() before get<type>()"	\
	   && is<ctype>());					\
    return var;							\
  }
  GET(bool, u_.boolean_)
  GET(double, u_.number_)
  GET(std::string, *u_.string_)
  GET(array, *u_.array_)
  GET(object, *u_.object_)
#undef GET
  
  inline bool value::evaluate_as_boolean() const {
    switch (type_) {
    case null_type:
      return false;
    case boolean_type:
      return u_.boolean_;
    case number_type:
      return u_.number_ != 0;
    case string_type:
      return ! u_.string_->empty();
    default:
      return true;
    }
  }
  
  inline const value& value::get(size_t idx) const {
    static value s_null;
    assert(is<array>());
    return idx < u_.array_->size() ? (*u_.array_)[idx] : s_null;
  }

  inline const value& value::get(const std::string& key) const {
    static value s_null;
    assert(is<object>());
    object::const_iterator i = u_.object_->find(key);
    return i != u_.object_->end() ? i->second : s_null;
  }

  inline bool value::contains(size_t idx) const {
    assert(is<array>());
    return idx < u_.array_->size();
  }

  inline bool value::contains(const std::string& key) const {
    assert(is<object>());
    object::const_iterator i = u_.object_->find(key);
    return i != u_.object_->end();
  }
  
  inline std::string value::to_str() const {
    switch (type_) {
    case null_type:      return "null";
    case boolean_type:   return u_.boolean_ ? "true" : "false";
    case number_type:    {
      char buf[256];
      double tmp;
      SNPRINTF(buf, sizeof(buf), fabs(u_.number_) < (1ULL << 53) && modf(u_.number_, &tmp) == 0 ? "%.f" : "%.17g", u_.number_);
      return buf;
    }
    case string_type:    return *u_.string_;
    case array_type:     return "array";
    case object_type:    return "object";
    default:             assert(0);
#ifdef _MSC_VER
      __assume(0);
#endif
    }
    return std::string();
  }
  
  template <typename Iter> void copy(const std::string& s, Iter oi) {
    std::copy(s.begin(), s.end(), oi);
  }
  
  template <typename Iter> void serialize_str(const std::string& s, Iter oi) {
    *oi++ = '"';
    for (std::string::const_iterator i = s.begin(); i != s.end(); ++i) {
      switch (*i) {
#define MAP(val, sym) case val: copy(sym, oi); break
	MAP('"', "\\\"");
	MAP('\\', "\\\\");
	MAP('/', "\\/");
	MAP('\b', "\\b");
	MAP('\f', "\\f");
	MAP('\n', "\\n");
	MAP('\r', "\\r");
	MAP('\t', "\\t");
#undef MAP
      default:
	if ((unsigned char)*i < 0x20 || *i == 0x7f) {
	  char buf[7];
	  SNPRINTF(buf, sizeof(buf), "\\u%04x", *i & 0xff);
	  copy(buf, buf + 6, oi);
	  } else {
	  *oi++ = *i;
	}
	break;
      }
    }
    *oi++ = '"';
  }
  
  template <typename Iter> void value::serialize(Iter oi) const {
    switch (type_) {
    case string_type:
      serialize_str(*u_.string_, oi);
      break;
    case array_type: {
      *oi++ = '[';
      for (array::const_iterator i = u_.array_->begin();
           i != u_.array_->end();
           ++i) {
	if (i != u_.array_->begin()) {
	  *oi++ = ',';
	}
	i->serialize(oi);
      }
      *oi++ = ']';
      break;
    }
    case object_type: {
      *oi++ = '{';
      for (object::const_iterator i = u_.object_->begin();
	   i != u_.object_->end();
	   ++i) {
	if (i != u_.object_->begin()) {
	  *oi++ = ',';
	}
	serialize_str(i->first, oi);
	*oi++ = ':';
	i->second.serialize(oi);
      }
      *oi++ = '}';
      break;
    }
    default:
      copy(to_str(), oi);
      break;
    }
  }
  
  inline std::string value::serialize() const {
    std::string s;
    serialize(std::back_inserter(s));
    return s;
  }
  
  template <typename Iter> class input {
  protected:
    Iter cur_, end_;
    int last_ch_;
    bool ungot_;
    int line_;
  public:
    input(const Iter& first, const Iter& last) : cur_(first), end_(last), last_ch_(-1), ungot_(false), line_(1) {}
    int getc() {
      if (ungot_) {
	ungot_ = false;
	return last_ch_;
      }
      if (cur_ == end_) {
	last_ch_ = -1;
	return -1;
      }
      if (last_ch_ == '\n') {
	line_++;
      }
      last_ch_ = *cur_++ & 0xff;
      return last_ch_;
    }
    void ungetc() {
      if (last_ch_ != -1) {
	assert(! ungot_);
	ungot_ = true;
      }
    }
    Iter cur() const { return cur_; }
    int line() const { return line_; }
    void skip_ws() {
      while (1) {
	int ch = getc();
	if (! (ch == ' ' || ch == '\t' || ch == '\n' || ch == '\r')) {
	  ungetc();
	  break;
	}
      }
    }
    bool expect(int expect) {
      skip_ws();
      if (getc() != expect) {
	ungetc();
	return false;
      }
      return true;
    }
    bool match(const std::string& pattern) {
      for (std::string::const_iterator pi(pattern.begin());
	   pi != pattern.end();
	   ++pi) {
	if (getc() != *pi) {
	  ungetc();
	  return false;
	}
      }
      return true;
    }
  };
  
  template<typename Iter> inline int _parse_quadhex(input<Iter> &in) {
    int uni_ch = 0, hex;
    for (int i = 0; i < 4; i++) {
      if ((hex = in.getc()) == -1) {
	return -1;
      }
      if ('0' <= hex && hex <= '9') {
	hex -= '0';
      } else if ('A' <= hex && hex <= 'F') {
	hex -= 'A' - 0xa;
      } else if ('a' <= hex && hex <= 'f') {
	hex -= 'a' - 0xa;
      } else {
	in.ungetc();
	return -1;
      }
      uni_ch = uni_ch * 16 + hex;
    }
    return uni_ch;
  }
  
  template<typename String, typename Iter> inline bool _parse_codepoint(String& out, input<Iter>& in) {
    int uni_ch;
    if ((uni_ch = _parse_quadhex(in)) == -1) {
      return false;
    }
    if (0xd800 <= uni_ch && uni_ch <= 0xdfff) {
      if (0xdc00 <= uni_ch) {
	// a second 16-bit of a surrogate pair appeared
	return false;
      }
      // first 16-bit of surrogate pair, get the next one
      if (in.getc() != '\\' || in.getc() != 'u') {
	in.ungetc();
	return false;
      }
      int second = _parse_quadhex(in);
      if (! (0xdc00 <= second && second <= 0xdfff)) {
	return false;
      }
      uni_ch = ((uni_ch - 0xd800) << 10) | ((second - 0xdc00) & 0x3ff);
      uni_ch += 0x10000;
    }
    if (uni_ch < 0x80) {
      out.push_back(uni_ch);
    } else {
      if (uni_ch < 0x800) {
	out.push_back(0xc0 | (uni_ch >> 6));
      } else {
	if (uni_ch < 0x10000) {
	  out.push_back(0xe0 | (uni_ch >> 12));
	} else {
	  out.push_back(0xf0 | (uni_ch >> 18));
	  out.push_back(0x80 | ((uni_ch >> 12) & 0x3f));
	}
	out.push_back(0x80 | ((uni_ch >> 6) & 0x3f));
      }
      out.push_back(0x80 | (uni_ch & 0x3f));
    }
    return true;
  }
  
  template<typename String, typename Iter> inline bool _parse_string(String& out, input<Iter>& in) {
    while (1) {
      int ch = in.getc();
      if (ch < ' ') {
	in.ungetc();
	return false;
      } else if (ch == '"') {
	return true;
      } else if (ch == '\\') {
	if ((ch = in.getc()) == -1) {
	  return false;
	}
	switch (ch) {
#define MAP(sym, val) case sym: out.push_back(val); break
	  MAP('"', '\"');
	  MAP('\\', '\\');
	  MAP('/', '/');
	  MAP('b', '\b');
	  MAP('f', '\f');
	  MAP('n', '\n');
	  MAP('r', '\r');
	  MAP('t', '\t');
#undef MAP
	case 'u':
	  if (! _parse_codepoint(out, in)) {
	    return false;
	  }
	  break;
	default:
	  return false;
	}
      } else {
	out.push_back(ch);
      }
    }
    return false;
  }
  
  template <typename Context, typename Iter> inline bool _parse_array(Context& ctx, input<Iter>& in) {
    if (! ctx.parse_array_start()) {
      return false;
    }
    size_t idx = 0;
    if (in.expect(']')) {
      return ctx.parse_array_stop(idx);
    }
    do {
      if (! ctx.parse_array_item(in, idx)) {
	return false;
      }
      idx++;
    } while (in.expect(','));
    return in.expect(']') && ctx.parse_array_stop(idx);
  }
  
  template <typename Context, typename Iter> inline bool _parse_object(Context& ctx, input<Iter>& in) {
    if (! ctx.parse_object_start()) {
      return false;
    }
    if (in.expect('}')) {
      return true;
    }
    do {
      std::string key;
      if (! in.expect('"')
	  || ! _parse_string(key, in)
	  || ! in.expect(':')) {
	return false;
      }
      if (! ctx.parse_object_item(in, key)) {
	return false;
      }
    } while (in.expect(','));
    return in.expect('}');
  }
  
  template <typename Iter> inline bool _parse_number(double& out, input<Iter>& in) {
    std::string num_str;
    while (1) {
      int ch = in.getc();
      if (('0' <= ch && ch <= '9') || ch == '+' || ch == '-' || ch == '.'
	  || ch == 'e' || ch == 'E') {
	num_str.push_back(ch);
      } else {
	in.ungetc();
	break;
      }
    }
    char* endp;
    out = strtod(num_str.c_str(), &endp);
    return endp == num_str.c_str() + num_str.size();
  }
  
  template <typename Context, typename Iter> inline bool _parse(Context& ctx, input<Iter>& in) {
    in.skip_ws();
    int ch = in.getc();
    switch (ch) {
#define IS(ch, text, op) case ch: \
      if (in.match(text) && op) { \
	return true; \
      } else { \
	return false; \
      }
      IS('n', "ull", ctx.set_null());
      IS('f', "alse", ctx.set_bool(false));
      IS('t', "rue", ctx.set_bool(true));
#undef IS
    case '"':
      return ctx.parse_string(in);
    case '[':
      return _parse_array(ctx, in);
    case '{':
      return _parse_object(ctx, in);
    default:
      if (('0' <= ch && ch <= '9') || ch == '-') {
	in.ungetc();
	double f;
	if (_parse_number(f, in)) {
	  ctx.set_number(f);
	  return true;
	} else {
	  return false;
	}
      }
      break;
    }
    in.ungetc();
    return false;
  }
  
  class deny_parse_context {
  public:
    bool set_null() { return false; }
    bool set_bool(bool) { return false; }
    bool set_number(double) { return false; }
    template <typename Iter> bool parse_string(input<Iter>&) { return false; }
    bool parse_array_start() { return false; }
    template <typename Iter> bool parse_array_item(input<Iter>&, size_t) {
      return false;
    }
    bool parse_array_stop(size_t) { return false; }
    bool parse_object_start() { return false; }
    template <typename Iter> bool parse_object_item(input<Iter>&, const std::string&) {
      return false;
    }
  };
  
  class default_parse_context {
  protected:
    value* out_;
  public:
    default_parse_context(value* out) : out_(out) {}
    bool set_null() {
      *out_ = value();
      return true;
    }
    bool set_bool(bool b) {
      *out_ = value(b);
      return true;
    }
    bool set_number(double f) {
      *out_ = value(f);
      return true;
    }
    template<typename Iter> bool parse_string(input<Iter>& in) {
      *out_ = value(string_type, false);
      return _parse_string(out_->get<std::string>(), in);
    }
    bool parse_array_start() {
      *out_ = value(array_type, false);
      return true;
    }
    template <typename Iter> bool parse_array_item(input<Iter>& in, size_t) {
      array& a = out_->get<array>();
      a.push_back(value());
      default_parse_context ctx(&a.back());
      return _parse(ctx, in);
    }
    bool parse_array_stop(size_t) { return true; }
    bool parse_object_start() {
      *out_ = value(object_type, false);
      return true;
    }
    template <typename Iter> bool parse_object_item(input<Iter>& in, const std::string& key) {
      object& o = out_->get<object>();
      default_parse_context ctx(&o[key]);
      return _parse(ctx, in);
    }
  private:
    default_parse_context(const default_parse_context&);
    default_parse_context& operator=(const default_parse_context&);
  };

  class null_parse_context {
  public:
    struct dummy_str {
      void push_back(int) {}
    };
  public:
    null_parse_context() {}
    bool set_null() { return true; }
    bool set_bool(bool) { return true; }
    bool set_number(double) { return true; }
    template <typename Iter> bool parse_string(input<Iter>& in) {
      dummy_str s;
      return _parse_string(s, in);
    }
    bool parse_array_start() { return true; }
    template <typename Iter> bool parse_array_item(input<Iter>& in, size_t) {
      return _parse(*this, in);
    }
    bool parse_array_stop(size_t) { return true; }
    bool parse_object_start() { return true; }
    template <typename Iter> bool parse_object_item(input<Iter>& in, const std::string&) {
      return _parse(*this, in);
    }
  private:
    null_parse_context(const null_parse_context&);
    null_parse_context& operator=(const null_parse_context&);
  };
  
  // obsolete, use the version below
  template <typename Iter> inline std::string parse(value& out, Iter& pos, const Iter& last) {
    std::string err;
    pos = parse(out, pos, last, &err);
    return err;
  }
  
  template <typename Context, typename Iter> inline Iter _parse(Context& ctx, const Iter& first, const Iter& last, std::string* err) {
    input<Iter> in(first, last);
    if (! _parse(ctx, in) && err != NULL) {
      char buf[64];
      SNPRINTF(buf, sizeof(buf), "syntax error at line %d near: ", in.line());
      *err = buf;
      while (1) {
	int ch = in.getc();
	if (ch == -1 || ch == '\n') {
	  break;
	} else if (ch >= ' ') {
	  err->push_back(ch);
	}
      }
    }
    return in.cur();
  }
  
  template <typename Iter> inline Iter parse(value& out, const Iter& first, const Iter& last, std::string* err) {
    default_parse_context ctx(&out);
    return _parse(ctx, first, last, err);
  }
  
  inline std::string parse(value& out, std::istream& is) {
    std::string err;
    parse(out, std::istreambuf_iterator<char>(is.rdbuf()),
	  std::istreambuf_iterator<char>(), &err);
    return err;
  }
  
  template <typename T> struct last_error_t {
    static std::string s;
  };
  template <typename T> std::string last_error_t<T>::s;
  
  inline void set_last_error(const std::string& s) {
    last_error_t<bool>::s = s;
  }
  
  inline const std::string& get_last_error() {
    return last_error_t<bool>::s;
  }

  inline bool operator==(const value& x, const value& y) {
    if (x.is<null>())
      return y.is<null>();
#define PICOJSON_CMP(type)					\
    if (x.is<type>())						\
      return y.is<type>() && x.get<type>() == y.get<type>()
    PICOJSON_CMP(bool);
    PICOJSON_CMP(double);
    PICOJSON_CMP(std::string);
    PICOJSON_CMP(array);
    PICOJSON_CMP(object);
#undef PICOJSON_CMP
    assert(0);
#ifdef _MSC_VER
    __assume(0);
#endif
    return false;
  }
  
  inline bool operator!=(const value& x, const value& y) {
    return ! (x == y);
  }
}

namespace std {
  template<> inline void swap(picojson::value& x, picojson::value& y)
    {
      x.swap(y);
    }
}

inline std::istream& operator>>(std::istream& is, picojson::value& x)
{
  picojson::set_last_error(std::string());
  std::string err = picojson::parse(x, is);
  if (! err.empty()) {
    picojson::set_last_error(err);
    is.setstate(std::ios::failbit);
  }
  return is;
}

inline std::ostream& operator<<(std::ostream& os, const picojson::value& x)
{
  x.serialize(std::ostream_iterator<char>(os));
  return os;
}
#ifdef _MSC_VER
    #pragma warning(pop)
#endif

#endif
#ifdef TEST_PICOJSON
#ifdef _MSC_VER
    #pragma warning(disable : 4127) // conditional expression is constant
#endif

using namespace std;
  
static void plan(int num)
{
  printf("1..%d\n", num);
}

static bool success = true;

static void ok(bool b, const char* name = "")
{
  static int n = 1;
  if (! b)
    success = false;
  printf("%s %d - %s\n", b ? "ok" : "ng", n++, name);
}

template <typename T> void is(const T& x, const T& y, const char* name = "")
{
  if (x == y) {
    ok(true, name);
  } else {
    ok(false, name);
  }
}

#include <algorithm>
#include <sstream>
#include <float.h>
#include <limits.h>

int main(void)
{
  plan(85);

  // constructors
#define TEST(expr, expected) \
    is(picojson::value expr .serialize(), string(expected), "picojson::value" #expr)
  
  TEST( (true),  "true");
  TEST( (false), "false");
  TEST( (42.0),   "42");
  TEST( (string("hello")), "\"hello\"");
  TEST( ("hello"), "\"hello\"");
  TEST( ("hello", 4), "\"hell\"");

  {
    double a = 1;
    for (int i = 0; i < 1024; i++) {
      picojson::value vi(a);
      std::stringstream ss;
      ss << vi;
      picojson::value vo;
      ss >> vo;
      double b = vo.get<double>();
      if ((i < 53 && a != b) || fabs(a - b) / b > 1e-8) {
        printf("ng i=%d a=%.18e b=%.18e\n", i, a, b);
      }
      a *= 2;
    }
  }
  
#undef TEST
  
#define TEST(in, type, cmp, serialize_test) {				\
    picojson::value v;							\
    const char* s = in;							\
    string err = picojson::parse(v, s, s + strlen(s));			\
    ok(err.empty(), in " no error");					\
    ok(v.is<type>(), in " check type");					\
    is<type>(v.get<type>(), cmp, in " correct output");			\
    is(*s, '\0', in " read to eof");					\
    if (serialize_test) {						\
      is(v.serialize(), string(in), in " serialize");			\
    }									\
  }
  TEST("false", bool, false, true);
  TEST("true", bool, true, true);
  TEST("90.5", double, 90.5, false);
  TEST("1.7976931348623157e+308", double, DBL_MAX, false);
  TEST("\"hello\"", string, string("hello"), true);
  TEST("\"\\\"\\\\\\/\\b\\f\\n\\r\\t\"", string, string("\"\\/\b\f\n\r\t"),
       true);
  TEST("\"\\u0061\\u30af\\u30ea\\u30b9\"", string,
       string("a\xe3\x82\xaf\xe3\x83\xaa\xe3\x82\xb9"), false);
  TEST("\"\\ud840\\udc0b\"", string, string("\xf0\xa0\x80\x8b"), false);
#undef TEST

#define TEST(type, expr) {					       \
    picojson::value v;						       \
    const char *s = expr;					       \
    string err = picojson::parse(v, s, s + strlen(s));		       \
    ok(err.empty(), "empty " #type " no error");		       \
    ok(v.is<picojson::type>(), "empty " #type " check type");	       \
    ok(v.get<picojson::type>().empty(), "check " #type " array size"); \
  }
  TEST(array, "[]");
  TEST(object, "{}");
#undef TEST
  
  {
    picojson::value v;
    const char *s = "[1,true,\"hello\"]";
    string err = picojson::parse(v, s, s + strlen(s));
    ok(err.empty(), "array no error");
    ok(v.is<picojson::array>(), "array check type");
    is(v.get<picojson::array>().size(), size_t(3), "check array size");
    ok(v.contains(0), "check contains array[0]");
    ok(v.get(0).is<double>(), "check array[0] type");
    is(v.get(0).get<double>(), 1.0, "check array[0] value");
    ok(v.contains(1), "check contains array[1]");
    ok(v.get(1).is<bool>(), "check array[1] type");
    ok(v.get(1).get<bool>(), "check array[1] value");
    ok(v.contains(2), "check contains array[2]");
    ok(v.get(2).is<string>(), "check array[2] type");
    is(v.get(2).get<string>(), string("hello"), "check array[2] value");
    ok(!v.contains(3), "check not contains array[3]");
  }
  
  {
    picojson::value v;
    const char *s = "{ \"a\": true }";
    string err = picojson::parse(v, s, s + strlen(s));
    ok(err.empty(), "object no error");
    ok(v.is<picojson::object>(), "object check type");
    is(v.get<picojson::object>().size(), size_t(1), "check object size");
    ok(v.contains("a"), "check contains property");
    ok(v.get("a").is<bool>(), "check bool property exists");
    is(v.get("a").get<bool>(), true, "check bool property value");
    is(v.serialize(), string("{\"a\":true}"), "serialize object");
    ok(!v.contains("z"), "check not contains property");
  }

#define TEST(json, msg) do {				\
    picojson::value v;					\
    const char *s = json;				\
    string err = picojson::parse(v, s, s + strlen(s));	\
    is(err, string("syntax error at line " msg), msg);	\
  } while (0)
  TEST("falsoa", "1 near: oa");
  TEST("{]", "1 near: ]");
  TEST("\n\bbell", "2 near: bell");
  TEST("\"abc\nd\"", "1 near: ");
#undef TEST
  
  {
    picojson::value v1, v2;
    const char *s;
    string err;
    s = "{ \"b\": true, \"a\": [1,2,\"three\"], \"d\": 2 }";
    err = picojson::parse(v1, s, s + strlen(s));
    s = "{ \"d\": 2.0, \"b\": true, \"a\": [1,2,\"three\"] }";
    err = picojson::parse(v2, s, s + strlen(s));
    ok((v1 == v2), "check == operator in deep comparison");
  }

  {
    picojson::value v1, v2;
    const char *s;
    string err;
    s = "{ \"b\": true, \"a\": [1,2,\"three\"], \"d\": 2 }";
    err = picojson::parse(v1, s, s + strlen(s));
    s = "{ \"d\": 2.0, \"a\": [1,\"three\"], \"b\": true }";
    err = picojson::parse(v2, s, s + strlen(s));
    ok((v1 != v2), "check != operator for array in deep comparison");
  }

  {
    picojson::value v1, v2;
    const char *s;
    string err;
    s = "{ \"b\": true, \"a\": [1,2,\"three\"], \"d\": 2 }";
    err = picojson::parse(v1, s, s + strlen(s));
    s = "{ \"d\": 2.0, \"a\": [1,2,\"three\"], \"b\": false }";
    err = picojson::parse(v2, s, s + strlen(s));
    ok((v1 != v2), "check != operator for object in deep comparison");
  }

  {
    picojson::value v1, v2;
    const char *s;
    string err;
    s = "{ \"b\": true, \"a\": [1,2,\"three\"], \"d\": 2 }";
    err = picojson::parse(v1, s, s + strlen(s));
    picojson::object& o = v1.get<picojson::object>();
    o.erase("b");
    picojson::array& a = o["a"].get<picojson::array>();
    picojson::array::iterator i;
    i = std::remove(a.begin(), a.end(), picojson::value(std::string("three")));
    a.erase(i, a.end());
    s = "{ \"a\": [1,2], \"d\": 2 }";
    err = picojson::parse(v2, s, s + strlen(s));
    ok((v1 == v2), "check erase()");
  }

  ok(picojson::value(3.0).serialize() == "3",
     "integral number should be serialized as a integer");
  
  {
    const char* s = "{ \"a\": [1,2], \"d\": 2 }";
    picojson::null_parse_context ctx;
    string err;
    picojson::_parse(ctx, s, s + strlen(s), &err);
    ok(err.empty(), "null_parse_context");
  }
  
  {
    picojson::value v1, v2;
    v1 = picojson::value(true);
    swap(v1, v2);
    ok(v1.is<picojson::null>(), "swap (null)");
    ok(v2.get<bool>() == true, "swap (bool)");

    v1 = picojson::value("a");
    v2 = picojson::value(1.0);
    swap(v1, v2);
    ok(v1.get<double>() == 1.0, "swap (dobule)");
    ok(v2.get<string>() == "a", "swap (string)");

    v1 = picojson::value(picojson::object());
    v2 = picojson::value(picojson::array());
    swap(v1, v2);
    ok(v1.is<picojson::array>(), "swap (array)");
    ok(v2.is<picojson::object>(), "swap (object)");
  }
  
  return success ? 0 : 1;
}

#endif


================================================
FILE: _example/mod_vtable/sqlite3_mod_vtable.cc
================================================
#include <string>
#include <sstream>
#include <sqlite3.h>
#include <sqlite3ext.h>
#include <curl/curl.h>
#include "picojson.h"

#ifdef _WIN32
# define EXPORT __declspec(dllexport)
#else
# define EXPORT
#endif

SQLITE_EXTENSION_INIT1;

typedef struct {
  char* data;   // response data from server
  size_t size;  // response size of data
} MEMFILE;

MEMFILE*
memfopen() {
  MEMFILE* mf = (MEMFILE*) malloc(sizeof(MEMFILE));
  if (mf) {
    mf->data = NULL;
    mf->size = 0;
  }
  return mf;
}

void
memfclose(MEMFILE* mf) {
  if (mf->data) free(mf->data);
  free(mf);
}

size_t
memfwrite(char* ptr, size_t size, size_t nmemb, void* stream) {
  MEMFILE* mf = (MEMFILE*) stream;
  int block = size * nmemb;
  if (!mf) return block; // through
  if (!mf->data)
    mf->data = (char*) malloc(block);
  else
    mf->data = (char*) realloc(mf->data, mf->size + block);
  if (mf->data) {
    memcpy(mf->data + mf->size, ptr, block);
    mf->size += block;
  }
  return block;
}

char*
memfstrdup(MEMFILE* mf) {
  char* buf;
  if (mf->size == 0) return NULL;
  buf = (char*) malloc(mf->size + 1);
  memcpy(buf, mf->data, mf->size);
  buf[mf->size] = 0;
  return buf;
}

static int
my_connect(sqlite3 *db, void *pAux, int argc, const char * const *argv, sqlite3_vtab **ppVTab, char **c) {
  std::stringstream ss;
  ss << "CREATE TABLE " << argv[0]
    << "(id int, full_name text, description text, html_url text)";
  int rc = sqlite3_declare_vtab(db, ss.str().c_str());
  *ppVTab = (sqlite3_vtab *) sqlite3_malloc(sizeof(sqlite3_vtab));
  memset(*ppVTab, 0, sizeof(sqlite3_vtab));
  return rc;
}

static int
my_create(sqlite3 *db, void *pAux, int argc, const char * const * argv, sqlite3_vtab **ppVTab, char **c) {
  return my_connect(db, pAux, argc, argv, ppVTab, c);
}

static int my_disconnect(sqlite3_vtab *pVTab) {
  sqlite3_free(pVTab);
  return SQLITE_OK;
}

static int
my_destroy(sqlite3_vtab *pVTab) {
  sqlite3_free(pVTab);
  return SQLITE_OK;
}

typedef struct {
  sqlite3_vtab_cursor base;
  int index;
  picojson::value* rows;
} cursor;

static int
my_open(sqlite3_vtab *pVTab, sqlite3_vtab_cursor **ppCursor) {
  MEMFILE* mf;
  CURL* curl;
  char* json;
  CURLcode res = CURLE_OK;
  char error[CURL_ERROR_SIZE] = {0};
  char* cert_file = getenv("SSL_CERT_FILE");

  mf = memfopen();
  curl = curl_easy_init();
  curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 1);
  curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 2);
  curl_easy_setopt(curl, CURLOPT_USERAGENT, "curl/7.29.0");
  curl_easy_setopt(curl, CURLOPT_URL, "https://api.github.com/repositories");
  if (cert_file)
    curl_easy_setopt(curl, CURLOPT_CAINFO, cert_file);
  curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1);
  curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, error);
  curl_easy_setopt(curl, CURLOPT_WRITEDATA, mf);
  curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, memfwrite);
  res = curl_easy_perform(curl);
  curl_easy_cleanup(curl);
  if (res != CURLE_OK) {
    std::cerr << error << std::endl;
    return SQLITE_FAIL;
  }

  picojson::value* v = new picojson::value;
  std::string err;
  picojson::parse(*v, mf->data, mf->data + mf->size, &err);
  memfclose(mf);

  if (!err.empty()) {
    delete v;
    std::cerr << err << std::endl;
    return SQLITE_FAIL;
  }

  cursor *c = (cursor *)sqlite3_malloc(sizeof(cursor));
  c->rows = v;
  c->index = 0;
  *ppCursor = &c->base;
  return SQLITE_OK;
}

static int
my_close(cursor *c) {
  delete c->rows;
  sqlite3_free(c);
  return SQLITE_OK;
}

static int
my_filter(cursor *c, int idxNum, const char *idxStr, int argc, sqlite3_value **argv) {
  c->index = 0;
  return SQLITE_OK;
}

static int
my_next(cursor *c) {
  c->index++;
  return SQLITE_OK;
}

static int
my_eof(cursor *c) {
  return c->index >= c->rows->get<picojson::array>().size() ? 1 : 0;
}

static int
my_column(cursor *c, sqlite3_context *ctxt, int i) {
  picojson::value v = c->rows->get<picojson::array>()[c->index];
  picojson::object row = v.get<picojson::object>();
  const char* p = NULL;
  switch (i) {
  case 0:
    p = row["id"].to_str().c_str();
    break;
  case 1:
    p = row["full_name"].to_str().c_str();
    break;
  case 2:
    p = row["description"].to_str().c_str();
    break;
  case 3:
    p = row["html_url"].to_str().c_str();
    break;
  }
  sqlite3_result_text(ctxt, strdup(p), strlen(p), free);
  return SQLITE_OK;
}

static int
my_rowid(cursor *c, sqlite3_int64 *pRowid) {
  *pRowid = c->index;
  return SQLITE_OK;
}

static int
my_bestindex(sqlite3_vtab *tab, sqlite3_index_info *pIdxInfo) {
  return SQLITE_OK;
}

static const sqlite3_module module = {
  0,
  my_create,
  my_connect,
  my_bestindex,
  my_disconnect,
  my_destroy,
  my_open,
  (int (*)(sqlite3_vtab_cursor *)) my_close,
  (int (*)(sqlite3_vtab_cursor *, int, char const *, int, sqlite3_value **)) my_filter,
  (int (*)(sqlite3_vtab_cursor *)) my_next,
  (int (*)(sqlite3_vtab_cursor *)) my_eof,
  (int (*)(sqlite3_vtab_cursor *, sqlite3_context *, int)) my_column,
  (int (*)(sqlite3_vtab_cursor *, sqlite3_int64 *)) my_rowid,
  NULL, // my_update
  NULL, // my_begin
  NULL, // my_sync
  NULL, // my_commit
  NULL, // my_rollback
  NULL, // my_findfunction
  NULL, // my_rename
};

static void
destructor(void *arg) {
  return;
}


extern "C" {

EXPORT int
sqlite3_extension_init(sqlite3 *db, char **errmsg, const sqlite3_api_routines *api) {
  SQLITE_EXTENSION_INIT2(api);
  sqlite3_create_module_v2(db, "github", &module, NULL, destructor);
  return 0;
}

}


================================================
FILE: _example/simple/Dockerfile
================================================
# =============================================================================
#  Multi-stage Dockerfile Example
# =============================================================================
#  This is a simple Dockerfile that will build an image of scratch-base image.
#  Usage:
#    docker build -t simple:local . && docker run --rm simple:local
# =============================================================================

# -----------------------------------------------------------------------------
#  Build Stage
# -----------------------------------------------------------------------------
FROM golang:alpine3.18 AS build

# Important:
#   Because this is a CGO enabled package, you are required to set it as 1.
ENV CGO_ENABLED=1

RUN apk add --no-cache \
    # Important: required for go-sqlite3
    gcc \
    # Required for Alpine
    musl-dev

WORKDIR /workspace

COPY . /workspace/

RUN \
    cd _example/simple && \
    go mod init github.com/mattn/sample && \
    go mod edit -replace=github.com/mattn/go-sqlite3=../.. && \
    go mod tidy && \
    go install -ldflags='-s -w -extldflags "-static"' ./simple.go

RUN \
    # Smoke test
    set -o pipefail; \
    /go/bin/simple | grep 99\ こんにちは世界099

# -----------------------------------------------------------------------------
#  Main Stage
# -----------------------------------------------------------------------------
FROM scratch

COPY --from=build /go/bin/simple /usr/local/bin/simple

ENTRYPOINT [ "/usr/local/bin/simple" ]


================================================
FILE: _example/simple/simple.go
================================================
package main

import (
	"database/sql"
	"fmt"
	_ "github.com/mattn/go-sqlite3"
	"log"
	"os"
)

func main() {
	os.Remove("./foo.db")

	db, err := sql.Open("sqlite3", "./foo.db")
	if err != nil {
		log.Fatal(err)
	}
	defer db.Close()

	sqlStmt := `
	create table foo (id integer not null primary key, name text);
	delete from foo;
	`
	_, err = db.Exec(sqlStmt)
	if err != nil {
		log.Printf("%q: %s\n", err, sqlStmt)
		return
	}

	tx, err := db.Begin()
	if err != nil {
		log.Fatal(err)
	}
	stmt, err := tx.Prepare("insert into foo(id, name) values(?, ?)")
	if err != nil {
		log.Fatal(err)
	}
	defer stmt.Close()
	for i := 0; i < 100; i++ {
		_, err = stmt.Exec(i, fmt.Sprintf("こんにちは世界%03d", i))
		if err != nil {
			log.Fatal(err)
		}
	}
	err = tx.Commit()
	if err != nil {
		log.Fatal(err)
	}

	rows, err := db.Query("select id, name from foo")
	if err != nil {
		log.Fatal(err)
	}
	defer rows.Close()
	for rows.Next() {
		var id int
		var name string
		err = rows.Scan(&id, &name)
		if err != nil {
			log.Fatal(err)
		}
		fmt.Println(id, name)
	}
	err = rows.Err()
	if err != nil {
		log.Fatal(err)
	}

	stmt, err = db.Prepare("select name from foo where id = ?")
	if err != nil {
		log.Fatal(err)
	}
	defer stmt.Close()
	var name string
	err = stmt.QueryRow("3").Scan(&name)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(name)

	_, err = db.Exec("delete from foo")
	if err != nil {
		log.Fatal(err)
	}

	_, err = db.Exec("insert into foo(id, name) values(1, 'foo'), (2, 'bar'), (3, 'baz')")
	if err != nil {
		log.Fatal(err)
	}

	rows, err = db.Query("select id, name from foo")
	if err != nil {
		log.Fatal(err)
	}
	defer rows.Close()
	for rows.Next() {
		var id int
		var name string
		err = rows.Scan(&id, &name)
		if err != nil {
			log.Fatal(err)
		}
		fmt.Println(id, name)
	}
	err = rows.Err()
	if err != nil {
		log.Fatal(err)
	}
}


================================================
FILE: _example/trace/main.go
================================================
package main

import (
	"database/sql"
	"fmt"
	"log"
	"os"

	sqlite3 "github.com/mattn/go-sqlite3"
)

func traceCallback(info sqlite3.TraceInfo) int {
	// Not very readable but may be useful; uncomment next line in case of doubt:
	//fmt.Printf("Trace: %#v\n", info)

	var dbErrText string
	if info.DBError.Code != 0 || info.DBError.ExtendedCode != 0 {
		dbErrText = fmt.Sprintf("; DB error: %#v", info.DBError)
	} else {
		dbErrText = "."
	}

	// Show the Statement-or-Trigger text in curly braces ('{', '}')
	// since from the *paired* ASCII characters they are
	// the least used in SQL syntax, therefore better visual delimiters.
	// Maybe show 'ExpandedSQL' the same way as 'StmtOrTrigger'.
	//
	// A known use of curly braces (outside strings) is
	// for ODBC escape sequences. Not likely to appear here.
	//
	// Template languages, etc. don't matter, we should see their *result*
	// at *this* level.
	// Strange curly braces in SQL code that reached the database driver
	// suggest that there is a bug in the application.
	// The braces are likely to be either template syntax or
	// a programming language's string interpolation syntax.

	var expandedText string
	if info.ExpandedSQL != "" {
		if info.ExpandedSQL == info.StmtOrTrigger {
			expandedText = " = exp"
		} else {
			expandedText = fmt.Sprintf(" expanded {%q}", info.ExpandedSQL)
		}
	} else {
		expandedText = ""
	}

	// SQLite docs as of September 6, 2016: Tracing and Profiling Functions
	// https://www.sqlite.org/c3ref/profile.html
	//
	// The profile callback time is in units of nanoseconds, however
	// the current implementation is only capable of millisecond resolution
	// so the six least significant digits in the time are meaningless.
	// Future versions of SQLite might provide greater resolution on the profiler callback.

	var runTimeText string
	if info.RunTimeNanosec == 0 {
		if info.EventCode == sqlite3.TraceProfile {
			//runTimeText = "; no time" // seems confusing
			runTimeText = "; time 0" // no measurement unit
		} else {
			//runTimeText = "; no time" // seems useless and confusing
		}
	} else {
		const nanosPerMillisec = 1000000
		if info.RunTimeNanosec%nanosPerMillisec == 0 {
			runTimeText = fmt.Sprintf("; time %d ms", info.RunTimeNanosec/nanosPerMillisec)
		} else {
			// unexpected: better than millisecond resolution
			runTimeText = fmt.Sprintf("; time %d ns!!!", info.RunTimeNanosec)
		}
	}

	var modeText string
	if info.AutoCommit {
		modeText = "-AC-"
	} else {
		modeText = "+Tx+"
	}

	fmt.Printf("Trace: ev %d %s conn 0x%x, stmt 0x%x {%q}%s%s%s\n",
		info.EventCode, modeText, info.ConnHandle, info.StmtHandle,
		info.StmtOrTrigger, expandedText,
		runTimeText,
		dbErrText)
	return 0
}

func main() {
	eventMask := sqlite3.TraceStmt | sqlite3.TraceProfile | sqlite3.TraceRow | sqlite3.TraceClose

	sql.Register("sqlite3_tracing",
		&sqlite3.SQLiteDriver{
			ConnectHook: func(conn *sqlite3.SQLiteConn) error {
				err := conn.SetTrace(&sqlite3.TraceConfig{
					Callback:        traceCallback,
					EventMask:       eventMask,
					WantExpandedSQL: true,
				})
				return err
			},
		})

	os.Exit(dbMain())
}

// Harder to do DB work in main().
// It's better with a separate function because
// 'defer' and 'os.Exit' don't go well together.
//
// DO NOT use 'log.Fatal...' below: remember that it's equivalent to
// Print() followed by a call to os.Exit(1) --- and
// we want to avoid Exit() so 'defer' can do cleanup.
// Use 'log.Panic...' instead.

func dbMain() int {
	db, err := sql.Open("sqlite3_tracing", ":memory:")
	if err != nil {
		fmt.Printf("Failed to open database: %#+v\n", err)
		return 1
	}
	defer db.Close()

	err = db.Ping()
	if err != nil {
		log.Panic(err)
	}

	dbSetup(db)

	dbDoInsert(db)
	dbDoInsertPrepared(db)
	dbDoSelect(db)
	dbDoSelectPrepared(db)

	return 0
}

// 'DDL' stands for "Data Definition Language":

// Note: "INTEGER PRIMARY KEY NOT NULL AUTOINCREMENT" causes the error
// 'near "AUTOINCREMENT": syntax error'; without "NOT NULL" it works.
const tableDDL = `CREATE TABLE t1 (
 id INTEGER PRIMARY KEY AUTOINCREMENT,
 note VARCHAR NOT NULL
)`

// 'DML' stands for "Data Manipulation Language":

const insertDML = "INSERT INTO t1 (note) VALUES (?)"
const selectDML = "SELECT id, note FROM t1 WHERE note LIKE ?"

const textPrefix = "bla-1234567890-"
const noteTextPattern = "%Prep%"

const nGenRows = 4 // Number of Rows to Generate (for *each* approach tested)

func dbSetup(db *sql.DB) {
	var err error

	_, err = db.Exec("DROP TABLE IF EXISTS t1")
	if err != nil {
		log.Panic(err)
	}
	_, err = db.Exec(tableDDL)
	if err != nil {
		log.Panic(err)
	}
}

func dbDoInsert(db *sql.DB) {
	const Descr = "DB-Exec"
	for i := 0; i < nGenRows; i++ {
		result, err := db.Exec(insertDML, textPrefix+Descr)
		if err != nil {
			log.Panic(err)
		}

		resultDoCheck(result, Descr, i)
	}
}

func dbDoInsertPrepared(db *sql.DB) {
	const Descr = "DB-Prepare"

	stmt, err := db.Prepare(insertDML)
	if err != nil {
		log.Panic(err)
	}
	defer stmt.Close()

	for i := 0; i < nGenRows; i++ {
		result, err := stmt.Exec(textPrefix + Descr)
		if err != nil {
			log.Panic(err)
		}

		resultDoCheck(result, Descr, i)
	}
}

func resultDoCheck(result sql.Result, callerDescr string, callIndex int) {
	lastID, err := result.LastInsertId()
	if err != nil {
		log.Panic(err)
	}
	nAffected, err := result.RowsAffected()
	if err != nil {
		log.Panic(err)
	}

	log.Printf("Exec result for %s (%d): ID = %d, affected = %d\n", callerDescr, callIndex, lastID, nAffected)
}

func dbDoSelect(db *sql.DB) {
	const Descr = "DB-Query"

	rows, err := db.Query(selectDML, noteTextPattern)
	if err != nil {
		log.Panic(err)
	}
	defer rows.Close()

	rowsDoFetch(rows, Descr)
}

func dbDoSelectPrepared(db *sql.DB) {
	const Descr = "DB-Prepare"

	stmt, err := db.Prepare(selectDML)
	if err != nil {
		log.Panic(err)
	}
	defer stmt.Close()

	rows, err := stmt.Query(noteTextPattern)
	if err != nil {
		log.Panic(err)
	}
	defer rows.Close()

	rowsDoFetch(rows, Descr)
}

func rowsDoFetch(rows *sql.Rows, callerDescr string) {
	var nRows int
	var id int64
	var note string

	for rows.Next() {
		err := rows.Scan(&id, &note)
		if err != nil {
			log.Panic(err)
		}
		log.Printf("Row for %s (%d): id=%d, note=%q\n",
			callerDescr, nRows, id, note)
		nRows++
	}
	if err := rows.Err(); err != nil {
		log.Panic(err)
	}
	log.Printf("Total %d rows for %s.\n", nRows, callerDescr)
}


================================================
FILE: _example/vtable/main.go
================================================
package main

import (
	"database/sql"
	"fmt"
	"log"

	"github.com/mattn/go-sqlite3"
)

func main() {
	sql.Register("sqlite3_with_extensions", &sqlite3.SQLiteDriver{
		ConnectHook: func(conn *sqlite3.SQLiteConn) error {
			return conn.CreateModule("github", &githubModule{})
		},
	})
	db, err := sql.Open("sqlite3_with_extensions", ":memory:")
	if err != nil {
		log.Fatal(err)
	}
	defer db.Close()

	_, err = db.Exec("create virtual table repo using github(id, full_name, description, html_url)")
	if err != nil {
		log.Fatal(err)
	}

	rows, err := db.Query("select id, full_name, description, html_url from repo")
	if err != nil {
		log.Fatal(err)
	}
	defer rows.Close()
	for rows.Next() {
		var id, fullName, description, htmlURL string
		rows.Scan(&id, &fullName, &description, &htmlURL)
		fmt.Printf("%s: %s\n\t%s\n\t%s\n\n", id, fullName, description, htmlURL)
	}
}


================================================
FILE: _example/vtable/vtable.go
================================================
package main

import (
	"encoding/json"
	"fmt"
	"io/ioutil"
	"net/http"

	"github.com/mattn/go-sqlite3"
)

type githubRepo struct {
	ID          int    `json:"id"`
	FullName    string `json:"full_name"`
	Description string `json:"description"`
	HTMLURL     string `json:"html_url"`
}

type githubModule struct {
}

func (m *githubModule) Create(c *sqlite3.SQLiteConn, args []string) (sqlite3.VTab, error) {
	err := c.DeclareVTab(fmt.Sprintf(`
		CREATE TABLE %s (
			id INT,
			full_name TEXT,
			description TEXT,
			html_url TEXT
		)`, args[0]))
	if err != nil {
		return nil, err
	}
	return &ghRepoTable{}, nil
}

func (m *githubModule) Connect(c *sqlite3.SQLiteConn, args []string) (sqlite3.VTab, error) {
	return m.Create(c, args)
}

func (m *githubModule) DestroyModule() {}

type ghRepoTable struct {
	repos []githubRepo
}

func (v *ghRepoTable) Open() (sqlite3.VTabCursor, error) {
	resp, err := http.Get("https://api.github.com/repositories")
	if err != nil {
		return nil, err
	}
	defer resp.Body.Close()

	body, err := ioutil.ReadAll(resp.Body)
	if err != nil {
		return nil, err
	}

	var repos []githubRepo
	if err := json.Unmarshal(body, &repos); err != nil {
		return nil, err
	}
	return &ghRepoCursor{0, repos}, nil
}

func (v *ghRepoTable) BestIndex(csts []sqlite3.InfoConstraint, ob []sqlite3.InfoOrderBy) (*sqlite3.IndexResult, error) {
	used := make([]bool, len(csts))
	return &sqlite3.IndexResult{
		IdxNum: 0,
		IdxStr: "default",
		Used:   used,
	}, nil
}

func (v *ghRepoTable) Disconnect() error { return nil }
func (v *ghRepoTable) Destroy() error    { return nil }

type ghRepoCursor struct {
	index int
	repos []githubRepo
}

func (vc *ghRepoCursor) Column(c *sqlite3.SQLiteContext, col int) error {
	switch col {
	case 0:
		c.ResultInt(vc.repos[vc.index].ID)
	case 1:
		c.ResultText(vc.repos[vc.index].FullName)
	case 2:
		c.ResultText(vc.repos[vc.index].Description)
	case 3:
		c.ResultText(vc.repos[vc.index].HTMLURL)
	}
	return nil
}

func (vc *ghRepoCursor) Filter(idxNum int, idxStr string, vals []any) error {
	vc.index = 0
	return nil
}

func (vc *ghRepoCursor) Next() error {
	vc.index++
	return nil
}

func (vc *ghRepoCursor) EOF() bool {
	return vc.index >= len(vc.repos)
}

func (vc *ghRepoCursor) Rowid() (int64, error) {
	return int64(vc.index), nil
}

func (vc *ghRepoCursor) Close() error {
	return nil
}


================================================
FILE: _example/vtable_eponymous_only/main.go
================================================
package main

import (
	"database/sql"
	"fmt"
	"log"

	"github.com/mattn/go-sqlite3"
)

func main() {
	sql.Register("sqlite3_with_extensions", &sqlite3.SQLiteDriver{
		ConnectHook: func(conn *sqlite3.SQLiteConn) error {
			return conn.CreateModule("series", &seriesModule{})
		},
	})
	db, err := sql.Open("sqlite3_with_extensions", ":memory:")
	if err != nil {
		log.Fatal(err)
	}
	defer db.Close()

	rows, err := db.Query("select * from series")
	if err != nil {
		log.Fatal(err)
	}
	defer rows.Close()
	for rows.Next() {
		var value int
		rows.Scan(&value)
		fmt.Printf("value: %d\n", value)
	}
}


================================================
FILE: _example/vtable_eponymous_only/vtable.go
================================================
package main

import (
	"fmt"

	"github.com/mattn/go-sqlite3"
)

type seriesModule struct{}

func (m *seriesModule) EponymousOnlyModule() {}

func (m *seriesModule) Create(c *sqlite3.SQLiteConn, args []string) (sqlite3.VTab, error) {
	err := c.DeclareVTab(fmt.Sprintf(`
		CREATE TABLE %s (
			value INT,
			start HIDDEN,
			stop HIDDEN,
			step HIDDEN
		)`, args[0]))
	if err != nil {
		return nil, err
	}
	return &seriesTable{0, 0, 1}, nil
}

func (m *seriesModule) Connect(c *sqlite3.SQLiteConn, args []string) (sqlite3.VTab, error) {
	return m.Create(c, args)
}

func (m *seriesModule) DestroyModule() {}

type seriesTable struct {
	start int64
	stop  int64
	step  int64
}

func (v *seriesTable) Open() (sqlite3.VTabCursor, error) {
	return &seriesCursor{v, 0}, nil
}

func (v *seriesTable) BestIndex(csts []sqlite3.InfoConstraint, ob []sqlite3.InfoOrderBy) (*sqlite3.IndexResult, error) {
	used := make([]bool, len(csts))
	for c, cst := range csts {
		if cst.Usable && cst.Op == sqlite3.OpEQ {
			used[c] = true
		}
	}

	return &sqlite3.IndexResult{
		IdxNum: 0,
		IdxStr: "default",
		Used:   used,
	}, nil
}

func (v *seriesTable) Disconnect() error { return nil }
func (v *seriesTable) Destroy() error    { return nil }

type seriesCursor struct {
	*seriesTable
	value int64
}

func (vc *seriesCursor) Column(c *sqlite3.SQLiteContext, col int) error {
	switch col {
	case 0:
		c.ResultInt64(vc.value)
	case 1:
		c.ResultInt64(vc.seriesTable.start)
	case 2:
		c.ResultInt64(vc.seriesTable.stop)
	case 3:
		c.ResultInt64(vc.seriesTable.step)
	}
	return nil
}

func (vc *seriesCursor) Filter(idxNum int, idxStr string, vals []any) error {
	switch {
	case len(vals) < 1:
		vc.seriesTable.start = 0
		vc.seriesTable.stop = 1000
		vc.value = vc.seriesTable.start
	case len(vals) < 2:
		vc.seriesTable.start = vals[0].(int64)
		vc.seriesTable.stop = 1000
		vc.value = vc.seriesTable.start
	case len(vals) < 3:
		vc.seriesTable.start = vals[0].(int64)
		vc.seriesTable.stop = vals[1].(int64)
		vc.value = vc.seriesTable.start
	case len(vals) < 4:
		vc.seriesTable.start = vals[0].(int64)
		vc.seriesTable.stop = vals[1].(int64)
		vc.seriesTable.step = vals[2].(int64)
	}

	return nil
}

func (vc *seriesCursor) Next() error {
	vc.value += vc.step
	return nil
}

func (vc *seriesCursor) EOF() bool {
	return vc.value > vc.stop
}

func (vc *seriesCursor) Rowid() (int64, error) {
	return int64(vc.value), nil
}

func (vc *seriesCursor) Close() error {
	return nil
}


================================================
FILE: backup.go
================================================
// Copyright (C) 2019 Yasuhiro Matsumoto <mattn.jp@gmail.com>.
//
// Use of this source code is governed by an MIT-style
// license that can be found in the LICENSE file.

package sqlite3

/*
#ifndef USE_LIBSQLITE3
#include "sqlite3-binding.h"
#else
#include <sqlite3.h>
#endif
#include <stdlib.h>
*/
import "C"
import (
	"runtime"
	"unsafe"
)

// SQLiteBackup implement interface of Backup.
type SQLiteBackup struct {
	b *C.sqlite3_backup
}

// Backup make backup from src to dest.
func (destConn *SQLiteConn) Backup(dest string, srcConn *SQLiteConn, src string) (*SQLiteBackup, error) {
	destptr := C.CString(dest)
	defer C.free(unsafe.Pointer(destptr))
	srcptr := C.CString(src)
	defer C.free(unsafe.Pointer(srcptr))

	if b := C.sqlite3_backup_init(destConn.db, destptr, srcConn.db, srcptr); b != nil {
		bb := &SQLiteBackup{b: b}
		runtime.SetFinalizer(bb, (*SQLiteBackup).Finish)
		return bb, nil
	}
	return nil, destConn.lastError()
}

// Step to backs up for one step. Calls the underlying `sqlite3_backup_step`
// function.  This function returns a boolean indicating if the backup is done
// and an error signalling any other error. Done is returned if the underlying
// C function returns SQLITE_DONE (Code 101)
func (b *SQLiteBackup) Step(p int) (bool, error) {
	ret := C.sqlite3_backup_step(b.b, C.int(p))
	if ret == C.SQLITE_DONE {
		return true, nil
	} else if ret != 0 && ret != C.SQLITE_LOCKED && ret != C.SQLITE_BUSY {
		return false, Error{Code: ErrNo(ret)}
	}
	return false, nil
}

// Remaining return whether have the rest for backup.
func (b *SQLiteBackup) Remaining() int {
	return int(C.sqlite3_backup_remaining(b.b))
}

// PageCount return count of pages.
func (b *SQLiteBackup) PageCount() int {
	return int(C.sqlite3_backup_pagecount(b.b))
}

// Finish close backup.
func (b *SQLiteBackup) Finish() error {
	return b.Close()
}

// Close close backup.
func (b *SQLiteBackup) Close() error {
	ret := C.sqlite3_backup_finish(b.b)

	// sqlite3_backup_finish() never fails, it just returns the
	// error code from previous operations, so clean up before
	// checking and returning an error
	b.b = nil
	runtime.SetFinalizer(b, nil)

	if ret != 0 {
		return Error{Code: ErrNo(ret)}
	}
	return nil
}


================================================
FILE: backup_test.go
================================================
// Copyright (C) 2019 Yasuhiro Matsumoto <mattn.jp@gmail.com>.
//
// Use of this source code is governed by an MIT-style
// license that can be found in the LICENSE file.

//go:build cgo
// +build cgo

package sqlite3

import (
	"database/sql"
	"fmt"
	"os"
	"testing"
	"time"
)

// The number of rows of test data to create in the source database.
// Can be used to control how many pages are available to be backed up.
const testRowCount = 100

// The maximum number of seconds after which the page-by-page backup is considered to have taken too long.
const usePagePerStepsTimeoutSeconds = 30

// Test the backup functionality.
func testBackup(t *testing.T, testRowCount int, usePerPageSteps bool) {
	// This function will be called multiple times.
	// It uses sql.Register(), which requires the name parameter value to be unique.
	// There does not currently appear to be a way to unregister a registered driver, however.
	// So generate a database driver name that will likely be unique.
	var driverName = fmt.Sprintf("sqlite3_testBackup_%v_%v_%v", testRowCount, usePerPageSteps, time.Now().UnixNano())

	// The driver's connection will be needed in order to perform the backup.
	driverConns := []*SQLiteConn{}
	sql.Register(driverName, &SQLiteDriver{
		ConnectHook: func(conn *SQLiteConn) error {
			driverConns = append(driverConns, conn)
			return nil
		},
	})

	// Connect to the source database.
	srcTempFilename := TempFilename(t)
	defer os.Remove(srcTempFilename)
	srcDb, err := sql.Open(driverName, srcTempFilename)
	if err != nil {
		t.Fatal("Failed to open the source database:", err)
	}
	defer srcDb.Close()
	err = srcDb.Ping()
	if err != nil {
		t.Fatal("Failed to connect to the source database:", err)
	}

	// Connect to the destination database.
	destTempFilename := TempFilename(t)
	defer os.Remove(destTempFilename)
	destDb, err := sql.Open(driverName, destTempFilename)
	if err != nil {
		t.Fatal("Failed to open the destination database:", err)
	}
	defer destDb.Close()
	err = destDb.Ping()
	if err != nil {
		t.Fatal("Failed to connect to the destination database:", err)
	}

	// Check the driver connections.
	if len(driverConns) != 2 {
		t.Fatalf("Expected 2 driver connections, but found %v.", len(driverConns))
	}
	srcDbDriverConn := driverConns[0]
	if srcDbDriverConn == nil {
		t.Fatal("The source database driver connection is nil.")
	}
	destDbDriverConn := driverConns[1]
	if destDbDriverConn == nil {
		t.Fatal("The destination database driver connection is nil.")
	}

	// Generate some test data for the given ID.
	var generateTestData = func(id int) string {
		return fmt.Sprintf("test-%v", id)
	}

	// Populate the source database with a test table containing some test data.
	tx, err := srcDb.Begin()
	if err != nil {
		t.Fatal("Failed to begin a transaction when populating the source database:", err)
	}
	_, err = srcDb.Exec("CREATE TABLE test (id INTEGER PRIMARY KEY, value TEXT)")
	if err != nil {
		tx.Rollback()
		t.Fatal("Failed to create the source database \"test\" table:", err)
	}
	for id := 0; id < testRowCount; id++ {
		_, err = srcDb.Exec("INSERT INTO test (id, value) VALUES (?, ?)", id, generateTestData(id))
		if err != nil {
			tx.Rollback()
			t.Fatal("Failed to insert a row into the source database \"test\" table:", err)
		}
	}
	err = tx.Commit()
	if err != nil {
		t.Fatal("Failed to populate the source database:", err)
	}

	// Confirm that the destination database is initially empty.
	var destTableCount int
	err = destDb.QueryRow("SELECT COUNT(*) FROM sqlite_master WHERE type = 'table'").Scan(&destTableCount)
	if err != nil {
		t.Fatal("Failed to check the destination table count:", err)
	}
	if destTableCount != 0 {
		t.Fatalf("The destination database is not empty; %v table(s) found.", destTableCount)
	}

	// Prepare to perform the backup.
	backup, err := destDbDriverConn.Backup("main", srcDbDriverConn, "main")
	if err != nil {
		t.Fatal("Failed to initialize the backup:", err)
	}

	// Allow the initial page count and remaining values to be retrieved.
	// According to <https://www.sqlite.org/c3ref/backup_finish.html>, the page count and remaining values are "... only updated by sqlite3_backup_step()."
	isDone, err := backup.Step(0)
	if err != nil {
		t.Fatal("Unable to perform an initial 0-page backup step:", err)
	}
	if isDone {
		t.Fatal("Backup is unexpectedly done.")
	}

	// Check that the page count and remaining values are reasonable.
	initialPageCount := backup.PageCount()
	if initialPageCount <= 0 {
		t.Fatalf("Unexpected initial page count value: %v", initialPageCount)
	}
	initialRemaining := backup.Remaining()
	if initialRemaining <= 0 {
		t.Fatalf("Unexpected initial remaining value: %v", initialRemaining)
	}
	if initialRemaining != initialPageCount {
		t.Fatalf("Initial remaining value differs from the initial page count value; remaining: %v; page count: %v", initialRemaining, initialPageCount)
	}

	// Perform the backup.
	if usePerPageSteps {
		var startTime = time.Now().Unix()

		// Test backing-up using a page-by-page approach.
		var latestRemaining = initialRemaining
		for {
			// Perform the backup step.
			isDone, err = backup.Step(1)
			if err != nil {
				t.Fatal("Failed to perform a backup step:", err)
			}

			// The page count should remain unchanged from its initial value.
			currentPageCount := backup.PageCount()
			if currentPageCount != initialPageCount {
				t.Fatalf("Current page count differs from the initial page count; initial page count: %v; current page count: %v", initialPageCount, currentPageCount)
			}

			// There should now be one less page remaining.
			currentRemaining := backup.Remaining()
			expectedRemaining := latestRemaining - 1
			if currentRemaining != expectedRemaining {
				t.Fatalf("Unexpected remaining value; expected remaining value: %v; actual remaining value: %v", expectedRemaining, currentRemaining)
			}
			latestRemaining = currentRemaining

			if isDone {
				break
			}

			// Limit the runtime of the backup attempt.
			if (time.Now().Unix() - startTime) > usePagePerStepsTimeoutSeconds {
				t.Fatal("Backup is taking longer than expected.")
			}
		}
	} else {
		// Test the copying of all remaining pages.
		isDone, err = backup.Step(-1)
		if err != nil {
			t.Fatal("Failed to perform a backup step:", err)
		}
		if !isDone {
			t.Fatal("Backup is unexpectedly not done.")
		}
	}

	// Check that the page count and remaining values are reasonable.
	finalPageCount := backup.PageCount()
	if finalPageCount != initialPageCount {
		t.Fatalf("Final page count differs from the initial page count; initial page count: %v; final page count: %v", initialPageCount, finalPageCount)
	}
	finalRemaining := backup.Remaining()
	if finalRemaining != 0 {
		t.Fatalf("Unexpected remaining value: %v", finalRemaining)
	}

	// Finish the backup.
	err = backup.Finish()
	if err != nil {
		t.Fatal("Failed to finish backup:", err)
	}

	// Confirm that the "test" table now exists in the destination database.
	var doesTestTableExist bool
	err = destDb.QueryRow("SELECT EXISTS (SELECT 1 FROM sqlite_master WHERE type = 'table' AND name = 'test' LIMIT 1) AS test_table_exists").Scan(&doesTestTableExist)
	if err != nil {
		t.Fatal("Failed to check if the \"test\" table exists in the destination database:", err)
	}
	if !doesTestTableExist {
		t.Fatal("The \"test\" table could not be found in the destination database.")
	}

	// Confirm that the number of rows in the destination database's "test" table matches that of the source table.
	var actualTestTableRowCount int
	err = destDb.QueryRow("SELECT COUNT(*) FROM test").Scan(&actualTestTableRowCount)
	if err != nil {
		t.Fatal("Failed to determine the rowcount of the \"test\" table in the destination database:", err)
	}
	if testRowCount != actualTestTableRowCount {
		t.Fatalf("Unexpected destination \"test\" table row count; expected: %v; found: %v", testRowCount, actualTestTableRowCount)
	}

	// Check each of the rows in the destination database.
	for id := 0; id < testRowCount; id++ {
		var checkedValue string
		err = destDb.QueryRow("SELECT value FROM test WHERE id = ?", id).Scan(&checkedValue)
		if err != nil {
			t.Fatal("Failed to query the \"test\" table in the destination database:", err)
		}

		var expectedValue = generateTestData(id)
		if checkedValue != expectedValue {
			t.Fatalf("Unexpected value in the \"test\" table in the destination database; expected value: %v; actual value: %v", expectedValue, checkedValue)
		}
	}
}

func TestBackupStepByStep(t *testing.T) {
	testBackup(t, testRowCount, true)
}

func TestBackupAllRemainingPages(t *testing.T) {
	testBackup(t, testRowCount, false)
}

// Test the error reporting when preparing to perform a backup.
func TestBackupError(t *testing.T) {
	const driverName = "sqlite3_TestBackupError"

	// The driver's connection will be needed in order to perform the backup.
	var dbDriverConn *SQLiteConn
	sql.Register(driverName, &SQLiteDriver{
		ConnectHook: func(conn *SQLiteConn) error {
			dbDriverConn = conn
			return nil
		},
	})

	// Connect to the database.
	dbTempFilename := TempFilename(t)
	defer os.Remove(dbTempFilename)
	db, err := sql.Open(driverName, dbTempFilename)
	if err != nil {
		t.Fatal("Failed to open the database:", err)
	}
	defer db.Close()
	db.Ping()

	// Need the driver connection in order to perform the backup.
	if dbDriverConn == nil {
		t.Fatal("Failed to get the driver connection.")
	}

	// Prepare to perform the backup.
	// Intentionally using the same connection for both the source and destination databases, to trigger an error result.
	backup, err := dbDriverConn.Backup("main", dbDriverConn, "main")
	if err == nil {
		t.Fatal("Failed to get the expected error result.")
	}
	const expectedError = "source and destination must be distinct"
	if err.Error() != expectedError {
		t.Fatalf("Unexpected error message; expected value: \"%v\"; actual value: \"%v\"", expectedError, err.Error())
	}
	if backup != nil {
		t.Fatal("Failed to get the expected nil backup result.")
	}
}


================================================
FILE: callback.go
================================================
// Copyright (C) 2019 Yasuhiro Matsumoto <mattn.jp@gmail.com>.
//
// Use of this source code is governed by an MIT-style
// license that can be found in the LICENSE file.

package sqlite3

// You can't export a Go function to C and have definitions in the C
// preamble in the same file, so we have to have callbackTrampoline in
// its own file. Because we need a separate file anyway, the support
// code for SQLite custom functions is in here.

/*
#ifndef USE_LIBSQLITE3
#include "sqlite3-binding.h"
#else
#include <sqlite3.h>
#endif
#include <stdlib.h>

void _sqlite3_result_text(sqlite3_context* ctx, const char* s);
void _sqlite3_result_blob(sqlite3_context* ctx, const void* b, int l);
*/
import "C"

import (
	"errors"
	"fmt"
	"math"
	"reflect"
	"sync"
	"unsafe"
)

//export callbackTrampoline
func callbackTrampoline(ctx *C.sqlite3_context, argc int, argv **C.sqlite3_value) {
	args := (*[(math.MaxInt32 - 1) / unsafe.Sizeof((*C.sqlite3_value)(nil))]*C.sqlite3_value)(unsafe.Pointer(argv))[:argc:argc]
	fi := lookupHandle(C.sqlite3_user_data(ctx)).(*functionInfo)
	fi.Call(ctx, args)
}

//export stepTrampoline
func stepTrampoline(ctx *C.sqlite3_context, argc C.int, argv **C.sqlite3_value) {
	args := (*[(math.MaxInt32 - 1) / unsafe.Sizeof((*C.sqlite3_value)(nil))]*C.sqlite3_value)(unsafe.Pointer(argv))[:int(argc):int(argc)]
	ai := lookupHandle(C.sqlite3_user_data(ctx)).(*aggInfo)
	ai.Step(ctx, args)
}

//export doneTrampoline
func doneTrampoline(ctx *C.sqlite3_context) {
	ai := lookupHandle(C.sqlite3_user_data(ctx)).(*aggInfo)
	ai.Done(ctx)
}

//export compareTrampoline
func compareTrampoline(handlePtr unsafe.Pointer, la C.int, a *C.char, lb C.int, b *C.char) C.int {
	cmp := lookupHandle(handlePtr).(func(string, string) int)
	return C.int(cmp(C.GoStringN(a, la), C.GoStringN(b, lb)))
}

//export commitHookTrampoline
func commitHookTrampoline(handle unsafe.Pointer) int {
	callback := lookupHandle(handle).(func() int)
	return callback()
}

//export rollbackHookTrampoline
func rollbackHookTrampoline(handle unsafe.Pointer) {
	callback := lookupHandle(handle).(func())
	callback()
}

//export updateHookTrampoline
func updateHookTrampoline(handle unsafe.Pointer, op int, db *C.char, table *C.char, rowid int64) {
	callback := lookupHandle(handle).(func(int, string, string, int64))
	callback(op, C.GoString(db), C.GoString(table), rowid)
}

//export authorizerTrampoline
func authorizerTrampoline(handle unsafe.Pointer, op int, arg1 *C.char, arg2 *C.char, arg3 *C.char) int {
	callback := lookupHandle(handle).(func(int, string, string, string) int)
	return callback(op, C.GoString(arg1), C.GoString(arg2), C.GoString(arg3))
}

//export preUpdateHookTrampoline
func preUpdateHookTrampoline(handle unsafe.Pointer, dbHandle uintptr, op int, db *C.char, table *C.char, oldrowid int64, newrowid int64) {
	hval := lookupHandleVal(handle)
	data := SQLitePreUpdateData{
		Conn:         hval.db,
		Op:           op,
		DatabaseName: C.GoString(db),
		TableName:    C.GoString(table),
		OldRowID:     oldrowid,
		NewRowID:     newrowid,
	}
	callback := hval.val.(func(SQLitePreUpdateData))
	callback(data)
}

// Use handles to avoid passing Go pointers to C.
type handleVal struct {
	db  *SQLiteConn
	val any
}

var handleLock sync.Mutex
var handleVals = make(map[unsafe.Pointer]handleVal)

func newHandle(db *SQLiteConn, v any) unsafe.Pointer {
	handleLock.Lock()
	defer handleLock.Unlock()
	val := handleVal{db: db, val: v}
	var p unsafe.Pointer = C.malloc(C.size_t(1))
	if p == nil {
		panic("can't allocate 'cgo-pointer hack index pointer': ptr == nil")
	}
	handleVals[p] = val
	return p
}

func lookupHandleVal(handle unsafe.Pointer) handleVal {
	handleLock.Lock()
	defer handleLock.Unlock()
	return handleVals[handle]
}

func lookupHandle(handle unsafe.Pointer) any {
	return lookupHandleVal(handle).val
}

func deleteHandles(db *SQLiteConn) {
	handleLock.Lock()
	defer handleLock.Unlock()
	for handle, val := range handleVals {
		if val.db == db {
			delete(handleVals, handle)
			C.free(handle)
		}
	}
}

// This is only here so that tests can refer to it.
type callbackArgRaw C.sqlite3_value

type callbackArgConverter func(*C.sqlite3_value) (reflect.Value, error)

type callbackArgCast struct {
	f   callbackArgConverter
	typ reflect.Type
}

func (c callbackArgCast) Run(v *C.sqlite3_value) (reflect.Value, error) {
	val, err := c.f(v)
	if err != nil {
		return reflect.Value{}, err
	}
	if !val.Type().ConvertibleTo(c.typ) {
		return reflect.Value{}, fmt.Errorf("cannot convert %s to %s", val.Type(), c.typ)
	}
	return val.Convert(c.typ), nil
}

func callbackArgInt64(v *C.sqlite3_value) (reflect.Value, error) {
	if C.sqlite3_value_type(v) != C.SQLITE_INTEGER {
		return reflect.Value{}, fmt.Errorf("argument must be an INTEGER")
	}
	return reflect.ValueOf(int64(C.sqlite3_value_int64(v))), nil
}

func callbackArgBool(v *C.sqlite3_value) (reflect.Value, error) {
	if C.sqlite3_value_type(v) != C.SQLITE_INTEGER {
		return reflect.Value{}, fmt.Errorf("argument must be an INTEGER")
	}
	i := int64(C.sqlite3_value_int64(v))
	val := false
	if i != 0 {
		val = true
	}
	return reflect.ValueOf(val), nil
}

func callbackArgFloat64(v *C.sqlite3_value) (reflect.Value, error) {
	if C.sqlite3_value_type(v) != C.SQLITE_FLOAT {
		return reflect.Value{}, fmt.Errorf("argument must be a FLOAT")
	}
	return reflect.ValueOf(float64(C.sqlite3_value_double(v))), nil
}

func callbackArgBytes(v *C.sqlite3_value) (reflect.Value, error) {
	switch C.sqlite3_value_type(v) {
	case C.SQLITE_BLOB:
		l := C.sqlite3_value_bytes(v)
		p := C.sqlite3_value_blob(v)
		return reflect.ValueOf(C.GoBytes(p, l)), nil
	case C.SQLITE_TEXT:
		l := C.sqlite3_value_bytes(v)
		c := unsafe.Pointer(C.sqlite3_value_text(v))
		return reflect.ValueOf(C.GoBytes(c, l)), nil
	default:
		return reflect.Value{}, fmt.Errorf("argument must be BLOB or TEXT")
	}
}

func callbackArgString(v *C.sqlite3_value) (reflect.Value, error) {
	switch C.sqlite3_value_type(v) {
	case C.SQLITE_BLOB:
		l := C.sqlite3_value_bytes(v)
		p := (*C.char)(C.sqlite3_value_blob(v))
		return reflect.ValueOf(C.GoStringN(p, l)), nil
	case C.SQLITE_TEXT:
		c := (*C.char)(unsafe.Pointer(C.sqlite3_value_text(v)))
		return reflect.ValueOf(C.GoString(c)), nil
	default:
		return reflect.Value{}, fmt.Errorf("argument must be BLOB or TEXT")
	}
}

func callbackArgGeneric(v *C.sqlite3_value) (reflect.Value, error) {
	switch C.sqlite3_value_type(v) {
	case C.SQLITE_INTEGER:
		return callbackArgInt64(v)
	case C.SQLITE_FLOAT:
		return callbackArgFloat64(v)
	case C.SQLITE_TEXT:
		return callbackArgString(v)
	case C.SQLITE_BLOB:
		return callbackArgBytes(v)
	case C.SQLITE_NULL:
		// Interpret NULL as a nil byte slice.
		var ret []byte
		return reflect.ValueOf(ret), nil
	default:
		panic("unreachable")
	}
}

func callbackArg(typ reflect.Type) (callbackArgConverter, error) {
	switch typ.Kind() {
	case reflect.Interface:
		if typ.NumMethod() != 0 {
			return nil, errors.New("the only supported interface type is any")
		}
		return callbackArgGeneric, nil
	case reflect.Slice:
		if typ.Elem().Kind() != reflect.Uint8 {
			return nil, errors.New("the only supported slice type is []byte")
		}
		return callbackArgBytes, nil
	case reflect.String:
		return callbackArgString, nil
	case reflect.Bool:
		return callbackArgBool, nil
	case reflect.Int64:
		return callbackArgInt64, nil
	case reflect.Int8, reflect.Int16, reflect.Int32, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Int, reflect.Uint:
		c := callbackArgCast{callbackArgInt64, typ}
		return c.Run, nil
	case reflect.Float64:
		return callbackArgFloat64, nil
	case reflect.Float32:
		c := callbackArgCast{callbackArgFloat64, typ}
		return c.Run, nil
	default:
		return nil, fmt.Errorf("don't know how to convert to %s", typ)
	}
}

func callbackConvertArgs(argv []*C.sqlite3_value, converters []callbackArgConverter, variadic callbackArgConverter) ([]reflect.Value, error) {
	var args []reflect.Value

	if len(argv) < len(converters) {
		return nil, fmt.Errorf("function requires at least %d arguments", len(converters))
	}

	for i, arg := range argv[:len(converters)] {
		v, err := converters[i](arg)
		if err != nil {
			return nil, err
		}
		args = append(args, v)
	}

	if variadic != nil {
		for _, arg := range argv[len(converters):] {
			v, err := variadic(arg)
			if err != nil {
				return nil, err
			}
			args = append(args, v)
		}
	}
	return args, nil
}

type callbackRetConverter func(*C.sqlite3_context, reflect.Value) error

func callbackRetInteger(ctx *C.sqlite3_context, v reflect.Value) error {
	switch v.Type().Kind() {
	case reflect.Int64:
	case reflect.Int8, reflect.Int16, reflect.Int32, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Int, reflect.Uint:
		v = v.Convert(reflect.TypeOf(int64(0)))
	case reflect.Bool:
		b := v.Interface().(bool)
		if b {
			v = reflect.ValueOf(int64(1))
		} else {
			v = reflect.ValueOf(int64(0))
		}
	default:
		return fmt.Errorf("cannot convert %s to INTEGER", v.Type())
	}

	C.sqlite3_result_int64(ctx, C.sqlite3_int64(v.Interface().(int64)))
	return nil
}

func callbackRetFloat(ctx *C.sqlite3_context, v reflect.Value) error {
	switch v.Type().Kind() {
	case reflect.Float64:
	case reflect.Float32:
		v = v.Convert(reflect.TypeOf(float64(0)))
	default:
		return fmt.Errorf("cannot convert %s to FLOAT", v.Type())
	}

	C.sqlite3_result_double(ctx, C.double(v.Interface().(float64)))
	return nil
}

func callbackRetBlob(ctx *C.sqlite3_context, v reflect.Value) error {
	if v.Type().Kind() != reflect.Slice || v.Type().Elem().Kind() != reflect.Uint8 {
		return fmt.Errorf("cannot convert %s to BLOB", v.Type())
	}
	i := v.Interface()
	if i == nil || len(i.([]byte)) == 0 {
		C.sqlite3_result_null(ctx)
	} else {
		bs := i.([]byte)
		C._sqlite3_result_blob(ctx, unsafe.Pointer(&bs[0]), C.int(len(bs)))
	}
	return nil
}

func callbackRetText(ctx *C.sqlite3_context, v reflect.Value) error {
	if v.Type().Kind() != reflect.String {
		return fmt.Errorf("cannot convert %s to TEXT", v.Type())
	}
	cstr := C.CString(v.Interface().(string))
	C._sqlite3_result_text(ctx, cstr)
	return nil
}

func callbackRetNil(ctx *C.sqlite3_context, v reflect.Value) error {
	return nil
}

func callbackRetGeneric(ctx *C.sqlite3_context, v reflect.Value) error {
	if v.IsNil() {
		C.sqlite3_result_null(ctx)
		return nil
	}

	cb, err := callbackRet(v.Elem().Type())
	if err != nil {
		return err
	}

	return cb(ctx, v.Elem())
}

func callbackRet(typ reflect.Type) (callbackRetConverter, error) {
	switch typ.Kind() {
	case reflect.Interface:
		errorInterface := reflect.TypeOf((*error)(nil)).Elem()
		if typ.Implements(errorInterface) {
			return callbackRetNil, nil
		}

		if typ.NumMethod() == 0 {
			return callbackRetGeneric, nil
		}

		fallthrough
	case reflect.Slice:
		if typ.Elem().Kind() != reflect.Uint8 {
			return nil, errors.New("the only supported slice type is []byte")
		}
		return callbackRetBlob, nil
	case reflect.String:
		return callbackRetText, nil
	case reflect.Bool, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Int, reflect.Uint:
		return callbackRetInteger, nil
	case reflect.Float32, reflect.Float64:
		return callbackRetFloat, nil
	default:
		return nil, fmt.Errorf("don't know how to convert to %s", typ)
	}
}

func callbackError(ctx *C.sqlite3_context, err error) {
	cstr := C.CString(err.Error())
	defer C.free(unsafe.Pointer(cstr))
	C.sqlite3_result_error(ctx, cstr, C.int(-1))
}

// Test support code. Tests are not allowed to import "C", so we can't
// declare any functions that use C.sqlite3_value.
func callbackSyntheticForTests(v reflect.Value, err error) callbackArgConverter {
	return func(*C.sqlite3_value) (reflect.Value, error) {
		return v, err
	}
}


================================================
FILE: callback_test.go
================================================
// Copyright (C) 2019 Yasuhiro Matsumoto <mattn.jp@gmail.com>.
//
// Use of this source code is governed by an MIT-style
// license that can be found in the LICENSE file.

//go:build cgo
// +build cgo

package sqlite3

import (
	"errors"
	"math"
	"reflect"
	"testing"
)

func TestCallbackArgCast(t *testing.T) {
	intConv := callbackSyntheticForTests(reflect.ValueOf(int64(math.MaxInt64)), nil)
	floatConv := callbackSyntheticForTests(reflect.ValueOf(float64(math.MaxFloat64)), nil)
	errConv := callbackSyntheticForTests(reflect.Value{}, errors.New("test"))

	tests := []struct {
		f callbackArgConverter
		o reflect.Value
	}{
		{intConv, reflect.ValueOf(int8(-1))},
		{intConv, reflect.ValueOf(int16(-1))},
		{intConv, reflect.ValueOf(int32(-1))},
		{intConv, reflect.ValueOf(uint8(math.MaxUint8))},
		{intConv, reflect.ValueOf(uint16(math.MaxUint16))},
		{intConv, reflect.ValueOf(uint32(math.MaxUint32))},
		// Special case, int64->uint64 is only 1<<63 - 1, not 1<<64 - 1
		{intConv, reflect.ValueOf(uint64(math.MaxInt64))},
		{floatConv, reflect.ValueOf(float32(math.Inf(1)))},
	}

	for _, test := range tests {
		conv := callbackArgCast{test.f, test.o.Type()}
		val, err := conv.Run(nil)
		if err != nil {
			t.Errorf("Couldn't convert to %s: %s", test.o.Type(), err)
		} else if !reflect.DeepEqual(val.Interface(), test.o.Interface()) {
			t.Errorf("Unexpected result from converting to %s: got %v, want %v", test.o.Type(), val.Interface(), test.o.Interface())
		}
	}

	conv := callbackArgCast{errConv, reflect.TypeOf(int8(0))}
	_, err := conv.Run(nil)
	if err == nil {
		t.Errorf("Expected error during callbackArgCast, but got none")
	}
}

func TestCallbackConverters(t *testing.T) {
	tests := []struct {
		v   any
		err bool
	}{
		// Unfortunately, we can't tell which converter was returned,
		// but we can at least check which types can be converted.
		{[]byte{0}, false},
		{"text", false},
		{true, false},
		{int8(0), false},
		{int16(0), false},
		{int32(0), false},
		{int64(0), false},
		{uint8(0), false},
		{uint16(0), false},
		{uint32(0), false},
		{uint64(0), false},
		{int(0), false},
		{uint(0), false},
		{float64(0), false},
		{float32(0), false},

		{func() {}, true},
		{complex64(complex(0, 0)), true},
		{complex128(complex(0, 0)), true},
		{struct{}{}, true},
		{map[string]string{}, true},
		{[]string{}, true},
		{(*int8)(nil), true},
		{make(chan int), true},
	}

	for _, test := range tests {
		_, err := callbackArg(reflect.TypeOf(test.v))
		if test.err && err == nil {
			t.Errorf("Expected an error when converting %s, got no error", reflect.TypeOf(test.v))
		} else if !test.err && err != nil {
			t.Errorf("Expected converter when converting %s, got error: %s", reflect.TypeOf(test.v), err)
		}
	}

	for _, test := range tests {
		_, err := callbackRet(reflect.TypeOf(test.v))
		if test.err && err == nil {
			t.Errorf("Expected an error when converting %s, got no error", reflect.TypeOf(test.v))
		} else if !test.err && err != nil {
			t.Errorf("Expected converter when converting %s, got error: %s", reflect.TypeOf(test.v), err)
		}
	}
}

func TestCallbackReturnAny(t *testing.T) {
	udf := func() any {
		return 1
	}

	typ := reflect.TypeOf(udf)
	_, err := callbackRet(typ.Out(0))
	if err != nil {
		t.Errorf("Expected valid callback for any return type, got: %s", err)
	}
}


================================================
FILE: convert.go
================================================
// Extracted from Go database/sql source code

// Copyright 2011 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

// Type conversions for Scan.

package sqlite3

import (
	"database/sql"
	"database/sql/driver"
	"errors"
	"fmt"
	"reflect"
	"strconv"
	"time"
)

var errNilPtr = errors.New("destination pointer is nil") // embedded in descriptive error

// convertAssign copies to dest the value in src, converting it if possible.
// An error is returned if the copy would result in loss of information.
// dest should be a pointer type.
func convertAssign(dest, src any) error {
	// Common cases, without reflect.
	switch s := src.(type) {
	case string:
		switch d := dest.(type) {
		case *string:
			if d == nil {
				return errNilPtr
			}
			*d = s
			return nil
		case *[]byte:
			if d == nil {
				return errNilPtr
			}
			*d = []byte(s)
			return nil
		case *sql.RawBytes:
			if d == nil {
				return errNilPtr
			}
			*d = append((*d)[:0], s...)
			return nil
		}
	case []byte:
		switch d := dest.(type) {
		case *string:
			if d == nil {
				return errNilPtr
			}
			*d = string(s)
			return nil
		case *any:
			if d == nil {
				return errNilPtr
			}
			*d = cloneBytes(s)
			return nil
		case *[]byte:
			if d == nil {
				return errNilPtr
			}
			*d = cloneBytes(s)
			return nil
		case *sql.RawBytes:
			if d == nil {
				return errNilPtr
			}
			*d = s
			return nil
		}
	case time.Time:
		switch d := dest.(type) {
		case *time.Time:
			*d = s
			return nil
		case *string:
			*d = s.Format(time.RFC3339Nano)
			return nil
		case *[]byte:
			if d == nil {
				return errNilPtr
			}
			*d = []byte(s.Format(time.RFC3339Nano))
			return nil
		case *sql.RawBytes:
			if d == nil {
				return errNilPtr
			}
			*d = s.AppendFormat((*d)[:0], time.RFC3339Nano)
			return nil
		}
	case nil:
		switch d := dest.(type) {
		case *any:
			if d == nil {
				return errNilPtr
			}
			*d = nil
			return nil
		case *[]byte:
			if d == nil {
				return errNilPtr
			}
			*d = nil
			return nil
		case *sql.RawBytes:
			if d == nil {
				return errNilPtr
			}
			*d = nil
			return nil
		}
	}

	var sv reflect.Value

	switch d := dest.(type) {
	case *string:
		sv = reflect.ValueOf(src)
		switch sv.Kind() {
		case reflect.Bool,
			reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64,
			reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64,
			reflect.Float32, reflect.Float64:
			*d = asString(src)
			return nil
		}
	case *[]byte:
		sv = reflect.ValueOf(src)
		if b, ok := asBytes(nil, sv); ok {
			*d = b
			return nil
		}
	case *sql.RawBytes:
		sv = reflect.ValueOf(src)
		if b, ok := asBytes([]byte(*d)[:0], sv); ok {
			*d = sql.RawBytes(b)
			return nil
		}
	case *bool:
		bv, err := driver.Bool.ConvertValue(src)
		if err == nil {
			*d = bv.(bool)
		}
		return err
	case *any:
		*d = src
		return nil
	}

	if scanner, ok := dest.(sql.Scanner); ok {
		return scanner.Scan(src)
	}

	dpv := reflect.ValueOf(dest)
	if dpv.Kind() != reflect.Ptr {
		return errors.New("destination not a pointer")
	}
	if dpv.IsNil() {
		return errNilPtr
	}

	if !sv.IsValid() {
		sv = reflect.ValueOf(src)
	}

	dv := reflect.Indirect(dpv)
	if sv.IsValid() && sv.Type().AssignableTo(dv.Type()) {
		switch b := src.(type) {
		case []byte:
			dv.Set(reflect.ValueOf(cloneBytes(b)))
		default:
			dv.Set(sv)
		}
		return nil
	}

	if dv.Kind() == sv.Kind() && sv.Type().ConvertibleTo(dv.Type()) {
		dv.Set(sv.Convert(dv.Type()))
		return nil
	}

	// The following conversions use a string value as an intermediate representation
	// to convert between various numeric types.
	//
	// This also allows scanning into user defined types such as "type Int int64".
	// For symmetry, also check for string destination types.
	switch dv.Kind() {
	case reflect.Ptr:
		if src == nil {
			dv.Set(reflect.Zero(dv.Type()))
			return nil
		}
		dv.Set(reflect.New(dv.Type().Elem()))
		return convertAssign(dv.Interface(), src)
	case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
		s := asString(src)
		i64, err := strconv.ParseInt(s, 10, dv.Type().Bits())
		if err != nil {
			err = strconvErr(err)
			return fmt.Errorf("converting driver.Value type %T (%q) to a %s: %v", src, s, dv.Kind(), err)
		}
		dv.SetInt(i64)
		return nil
	case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64:
		s := asString(src)
		u64, err := strconv.ParseUint(s, 10, dv.Type().Bits())
		if err != nil {
			err = strconvErr(err)
			return fmt.Errorf("converting driver.Value type %T (%q) to a %s: %v", src, s, dv.Kind(), err)
		}
		dv.SetUint(u64)
		return nil
	case reflect.Float32, reflect.Float64:
		s := asString(src)
		f64, err := strconv.ParseFloat(s, dv.Type().Bits())
		if err != nil {
			err = strconvErr(err)
			return fmt.Errorf("converting driver.Value type %T (%q) to a %s: %v", src, s, dv.Kind(), err)
		}
		dv.SetFloat(f64)
		return nil
	case reflect.String:
		switch v := src.(type) {
		case string:
			dv.SetString(v)
			return nil
		case []byte:
			dv.SetString(string(v))
			return nil
		}
	}

	return fmt.Errorf("unsupported Scan, storing driver.Value type %T into type %T", src, dest)
}

func strconvErr(err error) error {
	if ne, ok := err.(*strconv.NumError); ok {
		return ne.Err
	}
	return err
}

func cloneBytes(b []byte) []byte {
	if b == nil {
		return nil
	}
	c := make([]byte, len(b))
	copy(c, b)
	return c
}

func asString(src any) string {
	switch v := src.(type) {
	case string:
		return v
	case []byte:
		return string(v)
	}
	rv := reflect.ValueOf(src)
	switch rv.Kind() {
	case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
		return strconv.FormatInt(rv.Int(), 10)
	case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64:
		return strconv.FormatUint(rv.Uint(), 10)
	case reflect.Float64:
		return strconv.FormatFloat(rv.Float(), 'g', -1, 64)
	case reflect.Float32:
		return strconv.FormatFloat(rv.Float(), 'g', -1, 32)
	case reflect.Bool:
		return strconv.FormatBool(rv.Bool())
	}
	return fmt.Sprintf("%v", src)
}

func asBytes(buf []byte, rv reflect.Value) (b []byte, ok bool) {
	switch rv.Kind() {
	case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
		return strconv.AppendInt(buf, rv.Int(), 10), true
	case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64:
		return strconv.AppendUint(buf, rv.Uint(), 10), true
	case reflect.Float32:
		return strconv.AppendFloat(buf, rv.Float(), 'g', -1, 32), true
	case reflect.Float64:
		return strconv.AppendFloat(buf, rv.Float(), 'g', -1, 64), true
	case reflect.Bool:
		return strconv.AppendBool(buf, rv.Bool()), true
	case reflect.String:
		s := rv.String()
		return append(buf, s...), true
	}
	return
}


================================================
FILE: doc.go
================================================
/*
Package sqlite3 provides interface to SQLite3 databases.

This works as a driver for database/sql.

Installation

	go get github.com/mattn/go-sqlite3

# Supported Types

Currently, go-sqlite3 supports the following data types.

	+------------------------------+
	|go        | sqlite3           |
	|----------|-------------------|
	|nil       | null              |
	|int       | integer           |
	|int64     | integer           |
	|float64   | float             |
	|bool      | integer           |
	|[]byte    | blob              |
	|string    | text              |
	|time.Time | timestamp/datetime|
	+------------------------------+

# SQLite3 Extension

You can write your own extension module for sqlite3. For example, below is an
extension for a Regexp matcher operation.

	#include <pcre.h>
	#include <string.h>
	#include <stdio.h>
	#include <sqlite3ext.h>

	SQLITE_EXTENSION_INIT1
	static void regexp_func(sqlite3_context *context, int argc, sqlite3_value **argv) {
	  if (argc >= 2) {
	    const char *target  = (const char *)sqlite3_value_text(argv[1]);
	    const char *pattern = (const char *)sqlite3_value_text(argv[0]);
	    const char* errstr = NULL;
	    int erroff = 0;
	    int vec[500];
	    int n, rc;
	    pcre* re = pcre_compile(pattern, 0, &errstr, &erroff, NULL);
	    rc = pcre_exec(re, NULL, target, strlen(target), 0, 0, vec, 500);
	    if (rc <= 0) {
	      sqlite3_result_error(context, errstr, 0);
	      return;
	    }
	    sqlite3_result_int(context, 1);
	  }
	}

	#ifdef _WIN32
	__declspec(dllexport)
	#endif
	int sqlite3_extension_init(sqlite3 *db, char **errmsg,
	      const sqlite3_api_routines *api) {
	  SQLITE_EXTENSION_INIT2(api);
	  return sqlite3_create_function(db, "regexp", 2, SQLITE_UTF8,
	      (void*)db, regexp_func, NULL, NULL);
	}

It needs to be built as a so/dll shared library. And you need to register
the extension module like below.

	sql.Register("sqlite3_with_extensions",
		&sqlite3.SQLiteDriver{
			Extensions: []string{
				"sqlite3_mod_regexp",
			},
		})

Then, you can use this extension.

	rows, err := db.Query("select text from mytable where name regexp '^golang'")

# Connection Hook

You can hook and inject your code when the connection is established by setting
ConnectHook to get the SQLiteConn.

	sql.Register("sqlite3_with_hook_example",
			&sqlite3.SQLiteDriver{
					ConnectHook: func(conn *sqlite3.SQLiteConn) error {
						sqlite3conn = append(sqlite3conn, conn)
						return nil
					},
			})

You can also use database/sql.Conn.Raw (Go >= 1.13):

	conn, err := db.Conn(context.Background())
	// if err != nil { ... }
	defer conn.Close()
	err = conn.Raw(func (driverConn any) error {
		sqliteConn := driverConn.(*sqlite3.SQLiteConn)
		// ... use sqliteConn
	})
	// if err != nil { ... }

# Go SQlite3 Extensions

If you want to register Go functions as SQLite extension functions
you can make a custom driver by calling RegisterFunction from
ConnectHook.

	regex = func(re, s string) (bool, error) {
		return regexp.MatchString(re, s)
	}
	sql.Register("sqlite3_extended",
			&sqlite3.SQLiteDriver{
					ConnectHook: func(conn *sqlite3.SQLiteConn) error {
						return conn.RegisterFunc("regexp", regex, true)
					},
			})

You can then use the custom driver by passing its name to sql.Open.

	var i int
	conn, err := sql.Open("sqlite3_extended", "./foo.db")
	if err != nil {
		panic(err)
	}
	err = db.QueryRow(`SELECT regexp("foo.*", "seafood")`).Scan(&i)
	if err != nil {
		panic(err)
	}

See the documentation of RegisterFunc for more details.
*/
package sqlite3


================================================
FILE: error.go
================================================
// Copyright (C) 2019 Yasuhiro Matsumoto <mattn.jp@gmail.com>.
//
// Use of this source code is governed by an MIT-style
// license that can be found in the LICENSE file.

package sqlite3

/*
#ifndef USE_LIBSQLITE3
#include "sqlite3-binding.h"
#else
#include <sqlite3.h>
#endif
*/
import "C"
import "syscall"

// ErrNo inherit errno.
type ErrNo int

// ErrNoMask is mask code.
const ErrNoMask C.int = 0xff

// ErrNoExtended is extended errno.
type ErrNoExtended int

// Error implement sqlite error code.
type Error struct {
	Code         ErrNo         /* The error code returned by SQLite */
	ExtendedCode ErrNoExtended /* The extended error code returned by SQLite */
	SystemErrno  syscall.Errno /* The system errno returned by the OS through SQLite, if applicable */
	err          string        /* The error string returned by sqlite3_errmsg(),
	this usually contains more specific details. */
}

// result codes from http://www.sqlite.org/c3ref/c_abort.html
var (
	ErrError      = ErrNo(1)  /* SQL error or missing database */
	ErrInternal   = ErrNo(2)  /* Internal logic error in SQLite */
	ErrPerm       = ErrNo(3)  /* Access permission denied */
	ErrAbort      = ErrNo(4)  /* Callback routine requested an abort */
	ErrBusy       = ErrNo(5)  /* The database file is locked */
	ErrLocked     = ErrNo(6)  /* A table in the database is locked */
	ErrNomem      = ErrNo(7)  /* A malloc() failed */
	ErrReadonly   = ErrNo(8)  /* Attempt to write a readonly database */
	ErrInterrupt  = ErrNo(9)  /* Operation terminated by sqlite3_interrupt() */
	ErrIoErr      = ErrNo(10) /* Some kind of disk I/O error occurred */
	ErrCorrupt    = ErrNo(11) /* The database disk image is malformed */
	ErrNotFound   = ErrNo(12) /* Unknown opcode in sqlite3_file_control() */
	ErrFull       = ErrNo(13) /* Insertion failed because database is full */
	ErrCantOpen   = ErrNo(14) /* Unable to open the database file */
	ErrProtocol   = ErrNo(15) /* Database lock protocol error */
	ErrEmpty      = ErrNo(16) /* Database is empty */
	ErrSchema     = ErrNo(17) /* The database schema changed */
	ErrTooBig     = ErrNo(18) /* String or BLOB exceeds size limit */
	ErrConstraint = ErrNo(19) /* Abort due to constraint violation */
	ErrMismatch   = ErrNo(20) /* Data type mismatch */
	ErrMisuse     = ErrNo(21) /* Library used incorrectly */
	ErrNoLFS      = ErrNo(22) /* Uses OS features not supported on host */
	ErrAuth       = ErrNo(23) /* Authorization denied */
	ErrFormat     = ErrNo(24) /* Auxiliary database format error */
	ErrRange      = ErrNo(25) /* 2nd parameter to sqlite3_bind out of range */
	ErrNotADB     = ErrNo(26) /* File opened that is not a database file */
	ErrNotice     = ErrNo(27) /* Notifications from sqlite3_log() */
	ErrWarning    = ErrNo(28) /* Warnings from sqlite3_log() */
)

// Error return error message from errno.
func (err ErrNo) Error() string {
	return Error{Code: err}.Error()
}

// Extend return extended errno.
func (err ErrNo) Extend(by int) ErrNoExtended {
	return ErrNoExtended(int(err) | (by << 8))
}

// Error return error message that is extended code.
func (err ErrNoExtended) Error() string {
	return Error{Code: ErrNo(C.int(err) & ErrNoMask), ExtendedCode: err}.Error()
}

func (err Error) Error() string {
	var str string
	if err.err != "" {
		str = err.err
	} else {
		str = C.GoString(C.sqlite3_errstr(C.int(err.Code)))
	}
	if err.SystemErrno != 0 {
		str += ": " + err.SystemErrno.Error()
	}
	return str
}

// result codes from http://www.sqlite.org/c3ref/c_abort_rollback.html
var (
	ErrIoErrRead              = ErrIoErr.Extend(1)
	ErrIoErrShortRead         = ErrIoErr.Extend(2)
	ErrIoErrWrite             = ErrIoErr.Extend(3)
	ErrIoErrFsync             = ErrIoErr.Extend(4)
	ErrIoErrDirFsync          = ErrIoErr.Extend(5)
	ErrIoErrTruncate          = ErrIoErr.Extend(6)
	ErrIoErrFstat             = ErrIoErr.Extend(7)
	ErrIoErrUnlock            = ErrIoErr.Extend(8)
	ErrIoErrRDlock            = ErrIoErr.Extend(9)
	ErrIoErrDelete            = ErrIoErr.Extend(10)
	ErrIoErrBlocked           = ErrIoErr.Extend(11)
	ErrIoErrNoMem             = ErrIoErr.Extend(12)
	ErrIoErrAccess            = ErrIoErr.Extend(13)
	ErrIoErrCheckReservedLock = ErrIoErr.Extend(14)
	ErrIoErrLock              = ErrIoErr.Extend(15)
	ErrIoErrClose             = ErrIoErr.Extend(16)
	ErrIoErrDirClose          = ErrIoErr.Extend(17)
	ErrIoErrSHMOpen           = ErrIoErr.Extend(18)
	ErrIoErrSHMSize           = ErrIoErr.Extend(19)
	ErrIoErrSHMLock           = ErrIoErr.Extend(20)
	ErrIoErrSHMMap            = ErrIoErr.Extend(21)
	ErrIoErrSeek              = ErrIoErr.Extend(22)
	ErrIoErrDeleteNoent       = ErrIoErr.Extend(23)
	ErrIoErrMMap              = ErrIoErr.Extend(24)
	ErrIoErrGetTempPath       = ErrIoErr.Extend(25)
	ErrIoErrConvPath          = ErrIoErr.Extend(26)
	ErrLockedSharedCache      = ErrLocked.Extend(1)
	ErrBusyRecovery           = ErrBusy.Extend(1)
	ErrBusySnapshot           = ErrBusy.Extend(2)
	ErrCantOpenNoTempDir      = ErrCantOpen.Extend(1)
	ErrCantOpenIsDir          = ErrCantOpen.Extend(2)
	ErrCantOpenFullPath       = ErrCantOpen.Extend(3)
	ErrCantOpenConvPath       = ErrCantOpen.Extend(4)
	ErrCorruptVTab            = ErrCorrupt.Extend(1)
	ErrReadonlyRecovery       = ErrReadonly.Extend(1)
	ErrReadonlyCantLock       = ErrReadonly.Extend(2)
	ErrReadonlyRollback       = ErrReadonly.Extend(3)
	ErrReadonlyDbMoved        = ErrReadonly.Extend(4)
	ErrAbortRollback          = ErrAbort.Extend(2)
	ErrConstraintCheck        = ErrConstraint.Extend(1)
	ErrConstraintCommitHook   = ErrConstraint.Extend(2)
	ErrConstraintForeignKey   = ErrConstraint.Extend(3)
	ErrConstraintFunction     = ErrConstraint.Extend(4)
	ErrConstraintNotNull      = ErrConstraint.Extend(5)
	ErrConstraintPrimaryKey   = ErrConstraint.Extend(6)
	ErrConstraintTrigger      = ErrConstraint.Extend(7)
	ErrConstraintUnique       = ErrConstraint.Extend(8)
	ErrConstraintVTab         = ErrConstraint.Extend(9)
	ErrConstraintRowID        = ErrConstraint.Extend(10)
	ErrNoticeRecoverWAL       = ErrNotice.Extend(1)
	ErrNoticeRecoverRollback  = ErrNotice.Extend(2)
	ErrWarningAutoIndex       = ErrWarning.Extend(1)
)


================================================
FILE: error_test.go
================================================
// Copyright (C) 2019 Yasuhiro Matsumoto <mattn.jp@gmail.com>.
//
// Use of this source code is governed by an MIT-style
// license that can be found in the LICENSE file.

//go:build cgo
// +build cgo

package sqlite3

import (
	"database/sql"
	"io/ioutil"
	"os"
	"path"
	"testing"
)

func TestSimpleError(t *testing.T) {
	e := ErrError.Error()
	if e != "SQL logic error or missing database" && e != "SQL logic error" {
		t.Error("wrong error code: " + e)
	}
}

func TestCorruptDbErrors(t *testing.T) {
	dirName, err := ioutil.TempDir("", "sqlite3")
	if err != nil {
		t.Fatal(err)
	}
	defer os.RemoveAll(dirName)

	dbFileName := path.Join(dirName, "test.db")
	f, err := os.Create(dbFileName)
	if err != nil {
		t.Error(err)
	}
	f.Write([]byte{1, 2, 3, 4, 5})
	f.Close()

	db, err := sql.Open("sqlite3", dbFileName)
	if err == nil {
		_, err = db.Exec("drop table foo")
	}

	sqliteErr, ok := err.(Error)
	if !ok {
		t.Fatal(err)
	}
	if sqliteErr.Code != ErrNotADB {
		t.Error("wrong error code for corrupted DB")
	}
	if err.Error() == "" {
		t.Error("wrong error string for corrupted DB")
	}
	db.Close()
}

func TestSqlLogicErrors(t *testing.T) {
	dirName, err := ioutil.TempDir("", "sqlite3")
	if err != nil {
		t.Fatal(err)
	}
	defer os.RemoveAll(dirName)

	dbFileName := path.Join(dirName, "test.db")
	db, err := sql.Open("sqlite3", dbFileName)
	if err != nil {
		t.Error(err)
	}
	defer db.Close()

	_, err = db.Exec("CREATE TABLE Foo (id INTEGER PRIMARY KEY)")
	if err != nil {
		t.Error(err)
	}

	const expectedErr = "table Foo already exists"
	_, err = db.Exec("CREATE TABLE Foo (id INTEGER PRIMARY KEY)")
	if err.Error() != expectedErr {
		t.Errorf("Unexpected error: %s, expected %s", err.Error(), expectedErr)
	}

}

func TestExtendedErrorCodes_ForeignKey(t *testing.T) {
	dirName, err := ioutil.TempDir("", "sqlite3-err")
	if err != nil {
		t.Fatal(err)
	}
	defer os.RemoveAll(dirName)

	dbFileName := path.Join(dirName, "test.db")
	db, err := sql.Open("sqlite3", dbFileName)
	if err != nil {
		t.Error(err)
	}
	defer db.Close()

	_, err = db.Exec("PRAGMA foreign_keys=ON;")
	if err != nil {
		t.Errorf("PRAGMA foreign_keys=ON: %v", err)
	}

	_, err = db.Exec(`CREATE TABLE Foo (
		id INTEGER PRIMARY KEY AUTOINCREMENT,
		value INTEGER NOT NULL,
		ref INTEGER NULL REFERENCES Foo (id),
		UNIQUE(value)
	);`)
	if err != nil {
		t.Error(err)
	}

	_, err = db.Exec("INSERT INTO Foo (ref, value) VALUES (100, 100);")
	if err == nil {
		t.Error("No error!")
	} else {
		sqliteErr := err.(Error)
		if sqliteErr.Code != ErrConstraint {
			t.Errorf("Wrong basic error code: %d != %d",
				sqliteErr.Code, ErrConstraint)
		}
		if sqliteErr.ExtendedCode != ErrConstraintForeignKey {
			t.Errorf("Wrong extended error code: %d != %d",
				sqliteErr.ExtendedCode, ErrConstraintForeignKey)
		}
	}

}

func TestExtendedErrorCodes_NotNull(t *testing.T) {
	dirName, err := ioutil.TempDir("", "sqlite3-err")
	if err != nil {
		t.Fatal(err)
	}
	defer os.RemoveAll(dirName)

	dbFileName := path.Join(dirName, "test.db")
	db, err := sql.Open("sqlite3", dbFileName)
	if err != nil {
		t.Error(err)
	}
	defer db.Close()

	_, err = db.Exec("PRAGMA foreign_keys=ON;")
	if err != nil {
		t.Errorf("PRAGMA foreign_keys=ON: %v", err)
	}

	_, err = db.Exec(`CREATE TABLE Foo (
		id INTEGER PRIMARY KEY AUTOINCREMENT,
		value INTEGER NOT NULL,
		ref INTEGER NULL REFERENCES Foo (id),
		UNIQUE(value)
	);`)
	if err != nil {
		t.Error(err)
	}

	res, err := db.Exec("INSERT INTO Foo (value) VALUES (100);")
	if err != nil {
		t.Fatalf("Creating first row: %v", err)
	}

	id, err := res.LastInsertId()
	if err != nil {
		t.Fatalf("Retrieving last insert id: %v", err)
	}

	_, err = db.Exec("INSERT INTO Foo (ref) VALUES (?);", id)
	if err == nil {
		t.Error("No error!")
	} else {
		sqliteErr := err.(Error)
		if sqliteErr.Code != ErrConstraint {
			t.Errorf("Wrong basic error code: %d != %d",
				sqliteErr.Code, ErrConstraint)
		}
		if sqliteErr.ExtendedCode != ErrConstraintNotNull {
			t.Errorf("Wrong extended error code: %d != %d",
				sqliteErr.ExtendedCode, ErrConstraintNotNull)
		}
	}

}

func TestExtendedErrorCodes_Unique(t *testing.T) {
	dirName, err := ioutil.TempDir("", "sqlite3-err")
	if err != nil {
		t.Fatal(err)
	}
	defer os.RemoveAll(dirName)

	dbFileName := path.Join(dirName, "test.db")
	db, err := sql.Open("sqlite3", dbFileName)
	if err != nil {
		t.Error(err)
	}
	defer db.Close()

	_, err = db.Exec("PRAGMA foreign_keys=ON;")
	if err != nil {
		t.Errorf("PRAGMA foreign_keys=ON: %v", err)
	}

	_, err = db.Exec(`CREATE TABLE Foo (
		id INTEGER PRIMARY KEY AUTOINCREMENT,
		value INTEGER NOT NULL,
		ref INTEGER NULL REFERENCES Foo (id),
		UNIQUE(value)
	);`)
	if err != nil {
		t.Error(err)
	}

	res, err := db.Exec("INSERT INTO Foo (value) VALUES (100);")
	if err != nil {
		t.Fatalf("Creating first row: %v", err)
	}

	id, err := res.LastInsertId()
	if err != nil {
		t.Fatalf("Retrieving last insert id: %v", err)
	}

	_, err = db.Exec("INSERT INTO Foo (ref, value) VALUES (?, 100);", id)
	if err == nil {
		t.Error("No error!")
	} else {
		sqliteErr := err.(Error)
		if sqliteErr.Code != ErrConstraint {
			t.Errorf("Wrong basic error code: %d != %d",
				sqliteErr.Code, ErrConstraint)
		}
		if sqliteErr.ExtendedCode != ErrConstraintUnique {
			t.Errorf("Wrong extended error code: %d != %d",
				sqliteErr.ExtendedCode, ErrConstraintUnique)
		}
		extended := sqliteErr.Code.Extend(3).Error()
		expected := "constraint failed"
		if extended != expected {
			t.Errorf("Wrong basic error code: %q != %q",
				extended, expected)
		}
	}
}

func TestError_SystemErrno(t *testing.T) {
	_, n, _ := Version()
	if n < 3012000 {
		t.Skip("sqlite3_system_errno requires sqlite3 >= 3.12.0")
	}

	// open a non-existent database in read-only mode so we get an IO error.
	db, err := sql.Open("sqlite3", "file:nonexistent.db?mode=ro")
	if err != nil {
		t.Fatal(err)
	}
	defer db.Close()

	err = db.Ping()
	if err == nil {
		t.Fatal("expected error pinging read-only non-existent database, but got nil")
	}

	serr, ok := err.(Error)
	if !ok {
		t.Fatalf("expected error to be of type Error, but got %[1]T %[1]v", err)
	}

	if serr.SystemErrno == 0 {
		t.Fatal("expected SystemErrno to be set")
	}

	if !os.IsNotExist(serr.SystemErrno) {
		t.Errorf("expected SystemErrno to be a not exists error, but got %v", serr.SystemErrno)
	}
}


================================================
FILE: go.mod
================================================
module github.com/mattn/go-sqlite3

go 1.19

retract (
 [v2.0.0+incompatible, v2.0.6+incompatible] // Accidental; no major changes or features.
)


================================================
FILE: go.sum
================================================


================================================
FILE: sqlite3-binding.c
================================================
#ifndef USE_LIBSQLITE3
/******************************************************************************
** This file is an amalgamation of many separate C source files from SQLite
** version 3.51.3.  By combining all the individual C code files into this
** single large file, the entire code can be compiled as a single translation
** unit.  This allows many compilers to do optimizations that would not be
** possible if the files were compiled separately.  Performance improvements
** of 5% or more are commonly seen when SQLite is compiled as a single
** translation unit.
**
** This file is all you need to compile SQLite.  To use SQLite in other
** programs, you need this file and the "sqlite3.h" header file that defines
** the programming interface to the SQLite library.  (If you do not have
** the "sqlite3.h" header file at hand, you will find a copy embedded within
** the text of this file.  Search for "Begin file sqlite3.h" to find the start
** of the embedded sqlite3.h header file.) Additional code files may be needed
** if you want a wrapper to interface SQLite with your choice of programming
** language. The code for the "sqlite3" command-line shell is also in a
** separate file. This file contains only code for the core SQLite library.
**
** The content in this amalgamation comes from Fossil check-in
** 737ae4a34738ffa0c3ff7f9bb18df914dd1c with changes in files:
**
**    
*/
#ifndef SQLITE_AMALGAMATION
#define SQLITE_CORE 1
#define SQLITE_AMALGAMATION 1
#ifndef SQLITE_PRIVATE
# define SQLITE_PRIVATE static
#endif
/************** Begin file sqliteInt.h ***************************************/
/*
** 2001 September 15
**
** The author disclaims copyright to this source code.  In place of
** a legal notice, here is a blessing:
**
**    May you do good and not evil.
**    May you find forgiveness for yourself and forgive others.
**    May you share freely, never taking more than you give.
**
*************************************************************************
** Internal interface definitions for SQLite.
**
*/
#ifndef SQLITEINT_H
#define SQLITEINT_H

/* Special Comments:
**
** Some comments have special meaning to the tools that measure test
** coverage:
**
**    NO_TEST                     - The branches on this line are not
**                                  measured by branch coverage.  This is
**                                  used on lines of code that actually
**                                  implement parts of coverage testing.
**
**    OPTIMIZATION-IF-TRUE        - This branch is allowed to always be false
**                                  and the correct answer is still obtained,
**                                  though perhaps more slowly.
**
**    OPTIMIZATION-IF-FALSE       - This branch is allowed to always be true
**                                  and the correct answer is still obtained,
**                                  though perhaps more slowly.
**
**    PREVENTS-HARMLESS-OVERREAD  - This branch prevents a buffer overread
**                                  that would be harmless and undetectable
**                                  if it did occur.
**
** In all cases, the special comment must be enclosed in the usual
** slash-asterisk...asterisk-slash comment marks, with no spaces between the
** asterisks and the comment text.
*/

/*
** Make sure the Tcl calling convention macro is defined.  This macro is
** only used by test code and Tcl integration code.
*/
#ifndef SQLITE_TCLAPI
#  define SQLITE_TCLAPI
#endif

/*
** Include the header file used to customize the compiler options for MSVC.
** This should be done first so that it can successfully prevent spurious
** compiler warnings due to subsequent content in this file and other files
** that are included by this file.
*/
/************** Include msvc.h in the middle of sqliteInt.h ******************/
/************** Begin file msvc.h ********************************************/
/*
** 2015 January 12
**
** The author disclaims copyright to this source code.  In place of
** a legal notice, here is a blessing:
**
**    May you do good and not evil.
**    May you find forgiveness for yourself and forgive others.
**    May you share freely, never taking more than you give.
**
******************************************************************************
**
** This file contains code that is specific to MSVC.
*/
#ifndef SQLITE_MSVC_H
#define SQLITE_MSVC_H

#if defined(_MSC_VER)
#pragma warning(disable : 4054)
#pragma warning(disable : 4055)
#pragma warning(disable : 4100)
#pragma warning(disable : 4127)
#pragma warning(disable : 4130)
#pragma warning(disable : 4152)
#pragma warning(disable : 4189)
#pragma warning(disable : 4206)
#pragma warning(disable : 4210)
#pragma warning(disable : 4232)
#pragma warning(disable : 4244)
#pragma warning(disable : 4305)
#pragma warning(disable : 4306)
#pragma warning(disable : 4702)
#pragma warning(disable : 4706)
#endif /* defined(_MSC_VER) */

#if defined(_MSC_VER) && !defined(_WIN64)
#undef SQLITE_4_BYTE_ALIGNED_MALLOC
#define SQLITE_4_BYTE_ALIGNED_MALLOC
#endif /* defined(_MSC_VER) && !defined(_WIN64) */

#if !defined(HAVE_LOG2) && defined(_MSC_VER) && _MSC_VER<1800
#define HAVE_LOG2 0
#endif /* !defined(HAVE_LOG2) && defined(_MSC_VER) && _MSC_VER<1800 */

#endif /* SQLITE_MSVC_H */

/************** End of msvc.h ************************************************/
/************** Continuing where we left off in sqliteInt.h ******************/

/*
** Special setup for VxWorks
*/
/************** Include vxworks.h in the middle of sqliteInt.h ***************/
/************** Begin file vxworks.h *****************************************/
/*
** 2015-03-02
**
** The author disclaims copyright to this source code.  In place of
** a legal notice, here is a blessing:
**
**    May you do good and not evil.
**    May you find forgiveness for yourself and forgive others.
**    May you share freely, never taking more than you give.
**
******************************************************************************
**
** This file contains code that is specific to Wind River's VxWorks
*/
#if defined(__RTP__) || defined(_WRS_KERNEL)
/* This is VxWorks.  Set up things specially for that OS
*/
#include <vxWorks.h>
#include <pthread.h>  /* amalgamator: dontcache */
#define OS_VXWORKS 1
#define SQLITE_OS_OTHER 0
#define SQLITE_HOMEGROWN_RECURSIVE_MUTEX 1
#define SQLITE_OMIT_LOAD_EXTENSION 1
#define SQLITE_ENABLE_LOCKING_STYLE 0
#define HAVE_UTIME 1
#else
/* This is not VxWorks. */
#ifndef OS_VXWORKS
#  define OS_VXWORKS 0
#endif
#define HAVE_FCHOWN 1
#define HAVE_READLINK 1
#define HAVE_LSTAT 1
#endif /* defined(_WRS_KERNEL) */

/************** End of vxworks.h *********************************************/
/************** Continuing where we left off in sqliteInt.h ******************/

/*
** These #defines should enable >2GB file support on POSIX if the
** underlying operating system supports it.  If the OS lacks
** large file support, or if the OS is windows, these should be no-ops.
**
** Ticket #2739:  The _LARGEFILE_SOURCE macro must appear before any
** system #includes.  Hence, this block of code must be the very first
** code in all source files.
**
** Large file support can be disabled using the -DSQLITE_DISABLE_LFS switch
** on the compiler command line.  This is necessary if you are compiling
** on a recent machine (ex: Red Hat 7.2) but you want your code to work
** on an older machine (ex: Red Hat 6.0).  If you compile on Red Hat 7.2
** without this option, LFS is enable.  But LFS does not exist in the kernel
** in Red Hat 6.0, so the code won't work.  Hence, for maximum binary
** portability you should omit LFS.
**
** The previous paragraph was written in 2005.  (This paragraph is written
** on 2008-11-28.) These days, all Linux kernels support large files, so
** you should probably leave LFS enabled.  But some embedded platforms might
** lack LFS in which case the SQLITE_DISABLE_LFS macro might still be useful.
**
** Similar is true for Mac OS X.  LFS is only supported on Mac OS X 9 and later.
*/
#ifndef SQLITE_DISABLE_LFS
# define _LARGE_FILE       1
# ifndef _FILE_OFFSET_BITS
#   define _FILE_OFFSET_BITS 64
# endif
# define _LARGEFILE_SOURCE 1
#endif

/* The GCC_VERSION and MSVC_VERSION macros are used to
** conditionally include optimizations for each of these compilers.  A
** value of 0 means that compiler is not being used.  The
** SQLITE_DISABLE_INTRINSIC macro means do not use any compiler-specific
** optimizations, and hence set all compiler macros to 0
**
** There was once also a CLANG_VERSION macro.  However, we learn that the
** version numbers in clang are for "marketing" only and are inconsistent
** and unreliable.  Fortunately, all versions of clang also recognize the
** gcc version numbers and have reasonable settings for gcc version numbers,
** so the GCC_VERSION macro will be set to a correct non-zero value even
** when compiling with clang.
*/
#if defined(__GNUC__) && !defined(SQLITE_DISABLE_INTRINSIC)
# define GCC_VERSION (__GNUC__*1000000+__GNUC_MINOR__*1000+__GNUC_PATCHLEVEL__)
#else
# define GCC_VERSION 0
#endif
#if defined(_MSC_VER) && !defined(SQLITE_DISABLE_INTRINSIC)
# define MSVC_VERSION _MSC_VER
#else
# define MSVC_VERSION 0
#endif

/*
** Some C99 functions in "math.h" are only present for MSVC when its version
** is associated with Visual Studio 2013 or higher.
*/
#ifndef SQLITE_HAVE_C99_MATH_FUNCS
# if MSVC_VERSION==0 || MSVC_VERSION>=1800
#  define SQLITE_HAVE_C99_MATH_FUNCS (1)
# else
#  define SQLITE_HAVE_C99_MATH_FUNCS (0)
# endif
#endif

/* Needed for various definitions... */
#if defined(__GNUC__) && !defined(_GNU_SOURCE)
# define _GNU_SOURCE
#endif

#if defined(__OpenBSD__) && !defined(_BSD_SOURCE)
# define _BSD_SOURCE
#endif

/*
** Macro to disable warnings about missing "break" at the end of a "case".
*/
#if defined(__has_attribute)
#  if __has_attribute(fallthrough)
#    define deliberate_fall_through __attribute__((fallthrough));
#  endif
#endif
#if !defined(deliberate_fall_through)
#  define deliberate_fall_through
#endif

/*
** For MinGW, check to see if we can include the header file containing its
** version information, among other things.  Normally, this internal MinGW
** header file would [only] be included automatically by other MinGW header
** files; however, the contained version information is now required by this
** header file to work around binary compatibility issues (see below) and
** this is the only known way to reliably obtain it.  This entire #if block
** would be completely unnecessary if there was any other way of detecting
** MinGW via their preprocessor (e.g. if they customized their GCC to define
** some MinGW-specific macros).  When compiling for MinGW, either the
** _HAVE_MINGW_H or _HAVE__MINGW_H (note the extra underscore) macro must be
** defined; otherwise, detection of conditions specific to MinGW will be
** disabled.
*/
#if defined(_HAVE_MINGW_H)
# include "mingw.h"
#elif defined(_HAVE__MINGW_H)
# include "_mingw.h"
#endif

/*
** For MinGW version 4.x (and higher), check to see if the _USE_32BIT_TIME_T
** define is required to maintain binary compatibility with the MSVC runtime
** library in use (e.g. for Windows XP).
*/
#if !defined(_USE_32BIT_TIME_T) && !defined(_USE_64BIT_TIME_T) && \
    defined(_WIN32) && !defined(_WIN64) && \
    defined(__MINGW_MAJOR_VERSION) && __MINGW_MAJOR_VERSION >= 4 && \
    defined(__MSVCRT__)
# define _USE_32BIT_TIME_T
#endif

/* Optionally #include a user-defined header, whereby compilation options
** may be set prior to where they take effect, but after platform setup.
** If SQLITE_CUSTOM_INCLUDE=? is defined, its value names the #include
** file.
*/
#ifdef SQLITE_CUSTOM_INCLUDE
# define INC_STRINGIFY_(f) #f
# define INC_STRINGIFY(f) INC_STRINGIFY_(f)
# include INC_STRINGIFY(SQLITE_CUSTOM_INCLUDE)
#endif

/* The public SQLite interface.  The _FILE_OFFSET_BITS macro must appear
** first in QNX.  Also, the _USE_32BIT_TIME_T macro must appear first for
** MinGW.
*/
/************** Include sqlite3.h in the middle of sqliteInt.h ***************/
/************** Begin file sqlite3.h *****************************************/
/*
** 2001-09-15
**
** The author disclaims copyright to this source code.  In place of
** a legal notice, here is a blessing:
**
**    May you do good and not evil.
**    May you find forgiveness for yourself and forgive others.
**    May you share freely, never taking more than you give.
**
*************************************************************************
** This header file defines the interface that the SQLite library
** presents to client programs.  If a C-function, structure, datatype,
** or constant definition does not appear in this file, then it is
** not a published API of SQLite, is subject to change without
** notice, and should not be referenced by programs that use SQLite.
**
** Some of the definitions that are in this file are marked as
** "experimental".  Experimental interfaces are normally new
** features recently added to SQLite.  We do not anticipate changes
** to experimental interfaces but reserve the right to make minor changes
** if experience from use "in the wild" suggest such changes are prudent.
**
** The official C-language API documentation for SQLite is derived
** from comments in this file.  This file is the authoritative source
** on how SQLite interfaces are supposed to operate.
**
** The name of this file under configuration management is "sqlite.h.in".
** The makefile makes some minor changes to this file (such as inserting
** the version number) and changes its name to "sqlite3.h" as
** part of the build process.
*/
#ifndef SQLITE3_H
#define SQLITE3_H
#include <stdarg.h>     /* Needed for the definition of va_list */

/*
** Make sure we can call this stuff from C++.
*/
#if 0
extern "C" {
#endif


/*
** Facilitate override of interface linkage and calling conventions.
** Be aware that these macros may not be used within this particular
** translation of the amalgamation and its associated header file.
**
** The SQLITE_EXTERN and SQLITE_API macros are used to instruct the
** compiler that the target identifier should have external linkage.
**
** The SQLITE_CDECL macro is used to set the calling convention for
** public functions that accept a variable number of arguments.
**
** The SQLITE_APICALL macro is used to set the calling convention for
** public functions that accept a fixed number of arguments.
**
** The SQLITE_STDCALL macro is no longer used and is now deprecated.
**
** The SQLITE_CALLBACK macro is used to set the calling convention for
** function pointers.
**
** The SQLITE_SYSAPI macro is used to set the calling convention for
** functions provided by the operating system.
**
** Currently, the SQLITE_CDECL, SQLITE_APICALL, SQLITE_CALLBACK, and
** SQLITE_SYSAPI macros are used only when building for environments
** that require non-default calling conventions.
*/
#ifndef SQLITE_EXTERN
# define SQLITE_EXTERN extern
#endif
#ifndef SQLITE_API
# define SQLITE_API
#endif
#ifndef SQLITE_CDECL
# define SQLITE_CDECL
#endif
#ifndef SQLITE_APICALL
# define SQLITE_APICALL
#endif
#ifndef SQLITE_STDCALL
# define SQLITE_STDCALL SQLITE_APICALL
#endif
#ifndef SQLITE_CALLBACK
# define SQLITE_CALLBACK
#endif
#ifndef SQLITE_SYSAPI
# define SQLITE_SYSAPI
#endif

/*
** These no-op macros are used in front of interfaces to mark those
** interfaces as either deprecated or experimental.  New applications
** should not use deprecated interfaces - they are supported for backwards
** compatibility only.  Application writers should be aware that
** experimental interfaces are subject to change in point releases.
**
** These macros used to resolve to various kinds of compiler magic that
** would generate warning messages when they were used.  But that
** compiler magic ended up generating such a flurry of bug reports
** that we have taken it all out and gone back to using simple
** noop macros.
*/
#define SQLITE_DEPRECATED
#define SQLITE_EXPERIMENTAL

/*
** Ensure these symbols were not defined by some previous header file.
*/
#ifdef SQLITE_VERSION
# undef SQLITE_VERSION
#endif
#ifdef SQLITE_VERSION_NUMBER
# undef SQLITE_VERSION_NUMBER
#endif

/*
** CAPI3REF: Compile-Time Library Version Numbers
**
** ^(The [SQLITE_VERSION] C preprocessor macro in the sqlite3.h header
** evaluates to a string literal that is the SQLite version in the
** format "X.Y.Z" where X is the major version number (always 3 for
** SQLite3) and Y is the minor version number and Z is the release number.)^
** ^(The [SQLITE_VERSION_NUMBER] C preprocessor macro resolves to an integer
** with the value (X*1000000 + Y*1000 + Z) where X, Y, and Z are the same
** numbers used in [SQLITE_VERSION].)^
** The SQLITE_VERSION_NUMBER for any given release of SQLite will also
** be larger than the release from which it is derived.  Either Y will
** be held constant and Z will be incremented or else Y will be incremented
** and Z will be reset to zero.
**
** Since [version 3.6.18] ([dateof:3.6.18]),
** SQLite source code has been stored in the
** <a href="http://fossil-scm.org/">Fossil configuration management
** system</a>.  ^The SQLITE_SOURCE_ID macro evaluates to
** a string which identifies a particular check-in of SQLite
** within its configuration management system.  ^The SQLITE_SOURCE_ID
** string contains the date and time of the check-in (UTC) and a SHA1
** or SHA3-256 hash of the entire source tree.  If the source code has
** been edited in any way since it was last checked in, then the last
** four hexadecimal digits of the hash may be modified.
**
** See also: [sqlite3_libversion()],
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
** [sqlite_version()] and [sqlite_source_id()].
*/
#define SQLITE_VERSION        "3.51.3"
#define SQLITE_VERSION_NUMBER 3051003
#define SQLITE_SOURCE_ID      "2026-03-13 10:38:09 737ae4a34738ffa0c3ff7f9bb18df914dd1cad163f28fd6b6e114a344fe6d618"
#define SQLITE_SCM_BRANCH     "branch-3.51"
#define SQLITE_SCM_TAGS       "release version-3.51.3"
#define SQLITE_SCM_DATETIME   "2026-03-13T10:38:09.694Z"

/*
** CAPI3REF: Run-Time Library Version Numbers
** KEYWORDS: sqlite3_version sqlite3_sourceid
**
** These interfaces provide the same information as the [SQLITE_VERSION],
** [SQLITE_VERSION_NUMBER], and [SQLITE_SOURCE_ID] C preprocessor macros
** but are associated with the library instead of the header file.  ^(Cautious
** programmers might include assert() statements in their application to
** verify that values returned by these interfaces match the macros in
** the header, and thus ensure that the application is
** compiled with matching library and header files.
**
** <blockquote><pre>
** assert( sqlite3_libversion_number()==SQLITE_VERSION_NUMBER );
** assert( strncmp(sqlite3_sourceid(),SQLITE_SOURCE_ID,80)==0 );
** assert( strcmp(sqlite3_libversion(),SQLITE_VERSION)==0 );
** </pre></blockquote>)^
**
** ^The sqlite3_version[] string constant contains the text of the
** [SQLITE_VERSION] macro.  ^The sqlite3_libversion() function returns a
** pointer to the sqlite3_version[] string constant.  The sqlite3_libversion()
** function is provided for use in DLLs since DLL users usually do not have
** direct access to string constants within the DLL.  ^The
** sqlite3_libversion_number() function returns an integer equal to
** [SQLITE_VERSION_NUMBER].  ^(The sqlite3_sourceid() function returns
** a pointer to a string constant whose value is the same as the
** [SQLITE_SOURCE_ID] C preprocessor macro.  Except if SQLite is built
** using an edited copy of [the amalgamation], then the last four characters
** of the hash might be different from [SQLITE_SOURCE_ID].)^
**
** See also: [sqlite_version()] and [sqlite_source_id()].
*/
SQLITE_API const char sqlite3_version[] = SQLITE_VERSION;
SQLITE_API const char *sqlite3_libversion(void);
SQLITE_API const char *sqlite3_sourceid(void);
SQLITE_API int sqlite3_libversion_number(void);

/*
** CAPI3REF: Run-Time Library Compilation Options Diagnostics
**
** ^The sqlite3_compileoption_used() function returns 0 or 1
** indicating whether the specified option was defined at
** compile time.  ^The SQLITE_ prefix may be omitted from the
** option name passed to sqlite3_compileoption_used().
**
** ^The sqlite3_compileoption_get() function allows iterating
** over the list of options that were defined at compile time by
** returning the N-th compile time option string.  ^If N is out of range,
** sqlite3_compileoption_get() returns a NULL pointer.  ^The SQLITE_
** prefix is omitted from any strings returned by
** sqlite3_compileoption_get().
**
** ^Support for the diagnostic functions sqlite3_compileoption_used()
** and sqlite3_compileoption_get() may be omitted by specifying the
** [SQLITE_OMIT_COMPILEOPTION_DIAGS] option at compile time.
**
** See also: SQL functions [sqlite_compileoption_used()] and
** [sqlite_compileoption_get()] and the [compile_options pragma].
*/
#ifndef SQLITE_OMIT_COMPILEOPTION_DIAGS
SQLITE_API int sqlite3_compileoption_used(const char *zOptName);
SQLITE_API const char *sqlite3_compileoption_get(int N);
#else
# define sqlite3_compileoption_used(X) 0
# define sqlite3_compileoption_get(X)  ((void*)0)
#endif

/*
** CAPI3REF: Test To See If The Library Is Threadsafe
**
** ^The sqlite3_threadsafe() function returns zero if and only if
** SQLite was compiled with mutexing code omitted due to the
** [SQLITE_THREADSAFE] compile-time option being set to 0.
**
** SQLite can be compiled with or without mutexes.  When
** the [SQLITE_THREADSAFE] C preprocessor macro is 1 or 2, mutexes
** are enabled and SQLite is threadsafe.  When the
** [SQLITE_THREADSAFE] macro is 0,
** the mutexes are omitted.  Without the mutexes, it is not safe
** to use SQLite concurrently from more than one thread.
**
** Enabling mutexes incurs a measurable performance penalty.
** So if speed is of utmost importance, it makes sense to disable
** the mutexes.  But for maximum safety, mutexes should be enabled.
** ^The default behavior is for mutexes to be enabled.
**
** This interface can be used by an application to make sure that the
** version of SQLite that it is linking against was compiled with
** the desired setting of the [SQLITE_THREADSAFE] macro.
**
** This interface only reports on the compile-time mutex setting
** of the [SQLITE_THREADSAFE] flag.  If SQLite is compiled with
** SQLITE_THREADSAFE=1 or =2 then mutexes are enabled by default but
** can be fully or partially disabled using a call to [sqlite3_config()]
** with the verbs [SQLITE_CONFIG_SINGLETHREAD], [SQLITE_CONFIG_MULTITHREAD],
** or [SQLITE_CONFIG_SERIALIZED].  ^(The return value of the
** sqlite3_threadsafe() function shows only the compile-time setting of
** thread safety, not any run-time changes to that setting made by
** sqlite3_config(). In other words, the return value from sqlite3_threadsafe()
** is unchanged by calls to sqlite3_config().)^
**
** See the [threading mode] documentation for additional information.
*/
SQLITE_API int sqlite3_threadsafe(void);

/*
** CAPI3REF: Database Connection Handle
** KEYWORDS: {database connection} {database connections}
**
** Each open SQLite database is represented by a pointer to an instance of
** the opaque structure named "sqlite3".  It is useful to think of an sqlite3
** pointer as an object.  The [sqlite3_open()], [sqlite3_open16()], and
** [sqlite3_open_v2()] interfaces are its constructors, and [sqlite3_close()]
** and [sqlite3_close_v2()] are its destructors.  There are many other
** interfaces (such as
** [sqlite3_prepare_v2()], [sqlite3_create_function()], and
** [sqlite3_busy_timeout()] to name but three) that are methods on an
** sqlite3 object.
*/
typedef struct sqlite3 sqlite3;

/*
** CAPI3REF: 64-Bit Integer Types
** KEYWORDS: sqlite_int64 sqlite_uint64
**
** Because there is no cross-platform way to specify 64-bit integer types
** SQLite includes typedefs for 64-bit signed and unsigned integers.
**
** The sqlite3_int64 and sqlite3_uint64 are the preferred type definitions.
** The sqlite_int64 and sqlite_uint64 types are supported for backwards
** compatibility only.
**
** ^The sqlite3_int64 and sqlite_int64 types can store integer values
** between -9223372036854775808 and +9223372036854775807 inclusive.  ^The
** sqlite3_uint64 and sqlite_uint64 types can store integer values
** between 0 and +18446744073709551615 inclusive.
*/
#ifdef SQLITE_INT64_TYPE
  typedef SQLITE_INT64_TYPE sqlite_int64;
# ifdef SQLITE_UINT64_TYPE
    typedef SQLITE_UINT64_TYPE sqlite_uint64;
# else
    typedef unsigned SQLITE_INT64_TYPE sqlite_uint64;
# endif
#elif defined(_MSC_VER) || defined(__BORLANDC__)
  typedef __int64 sqlite_int64;
  typedef unsigned __int64 sqlite_uint64;
#else
  typedef long long int sqlite_int64;
  typedef unsigned long long int sqlite_uint64;
#endif
typedef sqlite_int64 sqlite3_int64;
typedef sqlite_uint64 sqlite3_uint64;

/*
** If compiling for a processor that lacks floating point support,
** substitute integer for floating-point.
*/
#ifdef SQLITE_OMIT_FLOATING_POINT
# define double sqlite3_int64
#endif

/*
** CAPI3REF: Closing A Database Connection
** DESTRUCTOR: sqlite3
**
** ^The sqlite3_close() and sqlite3_close_v2() routines are destructors
** for the [sqlite3] object.
** ^Calls to sqlite3_close() and sqlite3_close_v2() return [SQLITE_OK] if
** the [sqlite3] object is successfully destroyed and all associated
** resources are deallocated.
**
** Ideally, applications should [sqlite3_finalize | finalize] all
** [prepared statements], [sqlite3_blob_close | close] all [BLOB handles], and
** [sqlite3_backup_finish | finish] all [sqlite3_backup] objects associated
** with the [sqlite3] object prior to attempting to close the object.
** ^If the database connection is associated with unfinalized prepared
** statements, BLOB handlers, and/or unfinished sqlite3_backup objects then
** sqlite3_close() will leave the database connection open and return
** [SQLITE_BUSY]. ^If sqlite3_close_v2() is called with unfinalized prepared
** statements, unclosed BLOB handlers, and/or unfinished sqlite3_backups,
** it returns [SQLITE_OK] regardless, but instead of deallocating the database
** connection immediately, it marks the database connection as an unusable
** "zombie" and makes arrangements to automatically deallocate the database
** connection after all prepared statements are finalized, all BLOB handles
** are closed, and all backups have finished. The sqlite3_close_v2() interface
** is intended for use with host languages that are garbage collected, and
** where the order in which destructors are called is arbitrary.
**
** ^If an [sqlite3] object is destroyed while a transaction is open,
** the transaction is automatically rolled back.
**
** The C parameter to [sqlite3_close(C)] and [sqlite3_close_v2(C)]
** must be either a NULL
** pointer or an [sqlite3] object pointer obtained
** from [sqlite3_open()], [sqlite3_open16()], or
** [sqlite3_open_v2()], and not previously closed.
** ^Calling sqlite3_close() or sqlite3_close_v2() with a NULL pointer
** argument is a harmless no-op.
*/
SQLITE_API int sqlite3_close(sqlite3*);
SQLITE_API int sqlite3_close_v2(sqlite3*);

/*
** The type for a callback function.
** This is legacy and deprecated.  It is included for historical
** compatibility and is not documented.
*/
typedef int (*sqlite3_callback)(void*,int,char**, char**);

/*
** CAPI3REF: One-Step Query Execution Interface
** METHOD: sqlite3
**
** The sqlite3_exec() interface is a convenience wrapper around
** [sqlite3_prepare_v2()], [sqlite3_step()], and [sqlite3_finalize()],
** that allows an application to run multiple statements of SQL
** without having to use a lot of C code.
**
** ^The sqlite3_exec() interface runs zero or more UTF-8 encoded,
** semicolon-separated SQL statements passed into its 2nd argument,
** in the context of the [database connection] passed in as its 1st
** argument.  ^If the callback function of the 3rd argument to
** sqlite3_exec() is not NULL, then it is invoked for each result row
** coming out of the evaluated SQL statements.  ^The 4th argument to
** sqlite3_exec() is relayed through to the 1st argument of each
** callback invocation.  ^If the callback pointer to sqlite3_exec()
** is NULL, then no callback is ever invoked and result rows are
** ignored.
**
** ^If an error occurs while evaluating the SQL statements passed into
** sqlite3_exec(), then execution of the current statement stops and
** subsequent statements are skipped.  ^If the 5th parameter to sqlite3_exec()
** is not NULL then any error message is written into memory obtained
** from [sqlite3_malloc()] and passed back through the 5th parameter.
** To avoid memory leaks, the application should invoke [sqlite3_free()]
** on error message strings returned through the 5th parameter of
** sqlite3_exec() after the error message string is no longer needed.
** ^If the 5th parameter to sqlite3_exec() is not NULL and no errors
** occur, then sqlite3_exec() sets the pointer in its 5th parameter to
** NULL before returning.
**
** ^If an sqlite3_exec() callback returns non-zero, the sqlite3_exec()
** routine returns SQLITE_ABORT without invoking the callback again and
** without running any subsequent SQL statements.
**
** ^The 2nd argument to the sqlite3_exec() callback function is the
** number of columns in the result.  ^The 3rd argument to the sqlite3_exec()
** callback is an array of pointers to strings obtained as if from
** [sqlite3_column_text()], one for each column.  ^If an element of a
** result row is NULL then the corresponding string pointer for the
** sqlite3_exec() callback is a NULL pointer.  ^The 4th argument to the
** sqlite3_exec() callback is an array of pointers to strings where each
** entry represents the name of a corresponding result column as obtained
** from [sqlite3_column_name()].
**
** ^If the 2nd parameter to sqlite3_exec() is a NULL pointer, a pointer
** to an empty string, or a pointer that contains only whitespace and/or
** SQL comments, then no SQL statements are evaluated and the database
** is not changed.
**
** Restrictions:
**
** <ul>
** <li> The application must ensure that the 1st parameter to sqlite3_exec()
**      is a valid and open [database connection].
** <li> The application must not close the [database connection] specified by
**      the 1st parameter to sqlite3_exec() while sqlite3_exec() is running.
** <li> The application must not modify the SQL statement text passed into
**      the 2nd parameter of sqlite3_exec() while sqlite3_exec() is running.
** <li> The application must not dereference the arrays or string pointers
**       passed as the 3rd and 4th callback parameters after it returns.
** </ul>
*/
SQLITE_API int sqlite3_exec(
  sqlite3*,                                  /* An open database */
  const char *sql,                           /* SQL to be evaluated */
  int (*callback)(void*,int,char**,char**),  /* Callback function */
  void *,                                    /* 1st argument to callback */
  char **errmsg                              /* Error msg written here */
);

/*
** CAPI3REF: Result Codes
** KEYWORDS: {result code definitions}
**
** Many SQLite functions return an integer result code from the set shown
** here in order to indicate success or failure.
**
** New error codes may be added in future versions of SQLite.
**
** See also: [extended result code definitions]
*/
#define SQLITE_OK           0   /* Successful result */
/* beginning-of-error-codes */
#define SQLITE_ERROR        1   /* Generic error */
#define SQLITE_INTERNAL     2   /* Internal logic error in SQLite */
#define SQLITE_PERM         3   /* Access permission denied */
#define SQLITE_ABORT        4   /* Callback routine requested an abort */
#define SQLITE_BUSY         5   /* The database file is locked */
#define SQLITE_LOCKED       6   /* A table in the database is locked */
#define SQLITE_NOMEM        7   /* A malloc() failed */
#define SQLITE_READONLY     8   /* Attempt to write a readonly database */
#define SQLITE_INTERRUPT    9   /* Operation terminated by sqlite3_interrupt()*/
#define SQLITE_IOERR       10   /* Some kind of disk I/O error occurred */
#define SQLITE_CORRUPT     11   /* The database disk image is malformed */
#define SQLITE_NOTFOUND    12   /* Unknown opcode in sqlite3_file_control() */
#define SQLITE_FULL        13   /* Insertion failed because database is full */
#define SQLITE_CANTOPEN    14   /* Unable to open the database file */
#define SQLITE_PROTOCOL    15   /* Database lock protocol error */
#define SQLITE_EMPTY       16   /* Internal use only */
#define SQLITE_SCHEMA      17   /* The database schema changed */
#define SQLITE_TOOBIG      18   /* String or BLOB exceeds size limit */
#define SQLITE_CONSTRAINT  19   /* Abort due to constraint violation */
#define SQLITE_MISMATCH    20   /* Data type mismatch */
#define SQLITE_MISUSE      21   /* Library used incorrectly */
#define SQLITE_NOLFS       22   /* Uses OS features not supported on host */
#define SQLITE_AUTH        23   /* Authorization denied */
#define SQLITE_FORMAT      24   /* Not used */
#define SQLITE_RANGE       25   /* 2nd parameter to sqlite3_bind out of range */
#define SQLITE_NOTADB      26   /* File opened that is not a database file */
#define SQLITE_NOTICE      27   /* Notifications from sqlite3_log() */
#define SQLITE_WARNING     28   /* Warnings from sqlite3_log() */
#define SQLITE_ROW         100  /* sqlite3_step() has another row ready */
#define SQLITE_DONE        101  /* sqlite3_step() has finished executing */
/* end-of-error-codes */

/*
** CAPI3REF: Extended Result Codes
** KEYWORDS: {extended result code definitions}
**
** In its default configuration, SQLite API routines return one of 30 integer
** [result codes].  However, experience has shown that many of
** these result codes are too coarse-grained.  They do not provide as
** much information about problems as programmers might like.  In an effort to
** address this, newer versions of SQLite (version 3.3.8 [dateof:3.3.8]
** and later) include
** support for additional result codes that provide more detailed information
** about errors. These [extended result codes] are enabled or disabled
** on a per database connection basis using the
** [sqlite3_extended_result_codes()] API.  Or, the extended code for
** the most recent error can be obtained using
** [sqlite3_extended_errcode()].
*/
#define SQLITE_ERROR_MISSING_COLLSEQ   (SQLITE_ERROR | (1<<8))
#define SQLITE_ERROR_RETRY             (SQLITE_ERROR | (2<<8))
#define SQLITE_ERROR_SNAPSHOT          (SQLITE_ERROR | (3<<8))
#define SQLITE_ERROR_RESERVESIZE       (SQLITE_ERROR | (4<<8))
#define SQLITE_ERROR_KEY               (SQLITE_ERROR | (5<<8))
#define SQLITE_ERROR_UNABLE            (SQLITE_ERROR | (6<<8))
#define SQLITE_IOERR_READ              (SQLITE_IOERR | (1<<8))
#define SQLITE_IOERR_SHORT_READ        (SQLITE_IOERR | (2<<8))
#define SQLITE_IOERR_WRITE             (SQLITE_IOERR | (3<<8))
#define SQLITE_IOERR_FSYNC             (SQLITE_IOERR | (4<<8))
#define SQLITE_IOERR_DIR_FSYNC         (SQLITE_IOERR | (5<<8))
#define SQLITE_IOERR_TRUNCATE          (SQLITE_IOERR | (6<<8))
#define SQLITE_IOERR_FSTAT             (SQLITE_IOERR | (7<<8))
#define SQLITE_IOERR_UNLOCK            (SQLITE_IOERR | (8<<8))
#define SQLITE_IOERR_RDLOCK            (SQLITE_IOERR | (9<<8))
#define SQLITE_IOERR_DELETE            (SQLITE_IOERR | (10<<8))
#define SQLITE_IOERR_BLOCKED           (SQLITE_IOERR | (11<<8))
#define SQLITE_IOERR_NOMEM             (SQLITE_IOERR | (12<<8))
#define SQLITE_IOERR_ACCESS            (SQLITE_IOERR | (13<<8))
#define SQLITE_IOERR_CHECKRESERVEDLOCK (SQLITE_IOERR | (14<<8))
#define SQLITE_IOERR_LOCK              (SQLITE_IOERR | (15<<8))
#define SQLITE_IOERR_CLOSE             (SQLITE_IOERR | (16<<8))
#define SQLITE_IOERR_DIR_CLOSE         (SQLITE_IOERR | (17<<8))
#define SQLITE_IOERR_SHMOPEN           (SQLITE_IOERR | (18<<8))
#define SQLITE_IOERR_SHMSIZE           (SQLITE_IOERR | (19<<8))
#define SQLITE_IOERR_SHMLOCK           (SQLITE_IOERR | (20<<8))
#define SQLITE_IOERR_SHMMAP            (SQLITE_IOERR | (21<<8))
#define SQLITE_IOERR_SEEK              (SQLITE_IOERR | (22<<8))
#define SQLITE_IOERR_DELETE_NOENT      (SQLITE_IOERR | (23<<8))
#define SQLITE_IOERR_MMAP              (SQLITE_IOERR | (24<<8))
#define SQLITE_IOERR_GETTEMPPATH       (SQLITE_IOERR | (25<<8))
#define SQLITE_IOERR_CONVPATH          (SQLITE_IOERR | (26<<8))
#define SQLITE_IOERR_VNODE             (SQLITE_IOERR | (27<<8))
#define SQLITE_IOERR_AUTH              (SQLITE_IOERR | (28<<8))
#define SQLITE_IOERR_BEGIN_ATOMIC      (SQLITE_IOERR | (29<<8))
#define SQLITE_IOERR_COMMIT_ATOMIC     (SQLITE_IOERR | (30<<8))
#define SQLITE_IOERR_ROLLBACK_ATOMIC   (SQLITE_IOERR | (31<<8))
#define SQLITE_IOERR_DATA              (SQLITE_IOERR | (32<<8))
#define SQLITE_IOERR_CORRUPTFS         (SQLITE_IOERR | (33<<8))
#define SQLITE_IOERR_IN_PAGE           (SQLITE_IOERR | (34<<8))
#define SQLITE_IOERR_BADKEY            (SQLITE_IOERR | (35<<8))
#define SQLITE_IOERR_CODEC             (SQLITE_IOERR | (36<<8))
#define SQLITE_LOCKED_SHAREDCACHE      (SQLITE_LOCKED |  (1<<8))
#define SQLITE_LOCKED_VTAB             (SQLITE_LOCKED |  (2<<8))
#define SQLITE_BUSY_RECOVERY           (SQLITE_BUSY   |  (1<<8))
#define SQLITE_BUSY_SNAPSHOT           (SQLITE_BUSY   |  (2<<8))
#define SQLITE_BUSY_TIMEOUT            (SQLITE_BUSY   |  (3<<8))
#define SQLITE_CANTOPEN_NOTEMPDIR      (SQLITE_CANTOPEN | (1<<8))
#define SQLITE_CANTOPEN_ISDIR          (SQLITE_CANTOPEN | (2<<8))
#define SQLITE_CANTOPEN_FULLPATH       (SQLITE_CANTOPEN | (3<<8))
#define SQLITE_CANTOPEN_CONVPATH       (SQLITE_CANTOPEN | (4<<8))
#define SQLITE_CANTOPEN_DIRTYWAL       (SQLITE_CANTOPEN | (5<<8)) /* Not Used */
#define SQLITE_CANTOPEN_SYMLINK        (SQLITE_CANTOPEN | (6<<8))
#define SQLITE_CORRUPT_VTAB            (SQLITE_CORRUPT | (1<<8))
#define SQLITE_CORRUPT_SEQUENCE        (SQLITE_CORRUPT | (2<<8))
#define SQLITE_CORRUPT_INDEX           (SQLITE_CORRUPT | (3<<8))
#define SQLITE_READONLY_RECOVERY       (SQLITE_READONLY | (1<<8))
#define SQLITE_READONLY_CANTLOCK       (SQLITE_READONLY | (2<<8))
#define SQLITE_READONLY_ROLLBACK       (SQLITE_READONLY | (3<<8))
#define SQLITE_READONLY_DBMOVED        (SQLITE_READONLY | (4<<8))
#define SQLITE_READONLY_CANTINIT       (SQLITE_READONLY | (5<<8))
#define SQLITE_READONLY_DIRECTORY      (SQLITE_READONLY | (6<<8))
#define SQLITE_ABORT_ROLLBACK          (SQLITE_ABORT | (2<<8))
#define SQLITE_CONSTRAINT_CHECK        (SQLITE_CONSTRAINT | (1<<8))
#define SQLITE_CONSTRAINT_COMMITHOOK   (SQLITE_CONSTRAINT | (2<<8))
#define SQLITE_CONSTRAINT_FOREIGNKEY   (SQLITE_CONSTRAINT | (3<<8))
#define SQLITE_CONSTRAINT_FUNCTION     (SQLITE_CONSTRAINT | (4<<8))
#define SQLITE_CONSTRAINT_NOTNULL      (SQLITE_CONSTRAINT | (5<<8))
#define SQLITE_CONSTRAINT_PRIMARYKEY   (SQLITE_CONSTRAINT | (6<<8))
#define SQLITE_CONSTRAINT_TRIGGER      (SQLITE_CONSTRAINT | (7<<8))
#define SQLITE_CONSTRAINT_UNIQUE       (SQLITE_CONSTRAINT | (8<<8))
#define SQLITE_CONSTRAINT_VTAB         (SQLITE_CONSTRAINT | (9<<8))
#define SQLITE_CONSTRAINT_ROWID        (SQLITE_CONSTRAINT |(10<<8))
#define SQLITE_CONSTRAINT_PINNED       (SQLITE_CONSTRAINT |(11<<8))
#define SQLITE_CONSTRAINT_DATATYPE     (SQLITE_CONSTRAINT |(12<<8))
#define SQLITE_NOTICE_RECOVER_WAL      (SQLITE_NOTICE | (1<<8))
#define SQLITE_NOTICE_RECOVER_ROLLBACK (SQLITE_NOTICE | (2<<8))
#define SQLITE_NOTICE_RBU              (SQLITE_NOTICE | (3<<8))
#define SQLITE_WARNING_AUTOINDEX       (SQLITE_WARNING | (1<<8))
#define SQLITE_AUTH_USER               (SQLITE_AUTH | (1<<8))
#define SQLITE_OK_LOAD_PERMANENTLY     (SQLITE_OK | (1<<8))
#define SQLITE_OK_SYMLINK              (SQLITE_OK | (2<<8)) /* internal use only */

/*
** CAPI3REF: Flags For File Open Operations
**
** These bit values are intended for use in the
** 3rd parameter to the [sqlite3_open_v2()] interface and
** in the 4th parameter to the [sqlite3_vfs.xOpen] method.
**
** Only those flags marked as "Ok for sqlite3_open_v2()" may be
** used as the third argument to the [sqlite3_open_v2()] interface.
** The other flags have historically been ignored by sqlite3_open_v2(),
** though future versions of SQLite might change so that an error is
** raised if any of the disallowed bits are passed into sqlite3_open_v2().
** Applications should not depend on the historical behavior.
**
** Note in particular that passing the SQLITE_OPEN_EXCLUSIVE flag into
** [sqlite3_open_v2()] does *not* cause the underlying database file
** to be opened using O_EXCL.  Passing SQLITE_OPEN_EXCLUSIVE into
** [sqlite3_open_v2()] has historically been a no-op and might become an
** error in future versions of SQLite.
*/
#define SQLITE_OPEN_READONLY         0x00000001  /* Ok for sqlite3_open_v2() */
#define SQLITE_OPEN_READWRITE        0x00000002  /* Ok for sqlite3_open_v2() */
#define SQLITE_OPEN_CREATE           0x00000004  /* Ok for sqlite3_open_v2() */
#define SQLITE_OPEN_DELETEONCLOSE    0x00000008  /* VFS only */
#define SQLITE_OPEN_EXCLUSIVE        0x00000010  /* VFS only */
#define SQLITE_OPEN_AUTOPROXY        0x00000020  /* VFS only */
#define SQLITE_OPEN_URI              0x00000040  /* Ok for sqlite3_open_v2() */
#define SQLITE_OPEN_MEMORY           0x00000080  /* Ok for sqlite3_open_v2() */
#define SQLITE_OPEN_MAIN_DB          0x00000100  /* VFS only */
#define SQLITE_OPEN_TEMP_DB          0x00000200  /* VFS only */
#define SQLITE_OPEN_TRANSIENT_DB     0x00000400  /* VFS only */
#define SQLITE_OPEN_MAIN_JOURNAL     0x00000800  /* VFS only */
#define SQLITE_OPEN_TEMP_JOURNAL     0x00001000  /* VFS only */
#define SQLITE_OPEN_SUBJOURNAL       0x00002000  /* VFS only */
#define SQLITE_OPEN_SUPER_JOURNAL    0x00004000  /* VFS only */
#define SQLITE_OPEN_NOMUTEX          0x00008000  /* Ok for sqlite3_open_v2() */
#define SQLITE_OPEN_FULLMUTEX        0x00010000  /* Ok for sqlite3_open_v2() */
#define SQLITE_OPEN_SHAREDCACHE      0x00020000  /* Ok for sqlite3_open_v2() */
#define SQLITE_OPEN_PRIVATECACHE     0x00040000  /* Ok for sqlite3_open_v2() */
#define SQLITE_OPEN_WAL              0x00080000  /* VFS only */
#define SQLITE_OPEN_NOFOLLOW         0x01000000  /* Ok for sqlite3_open_v2() */
#define SQLITE_OPEN_EXRESCODE        0x02000000  /* Extended result codes */

/* Reserved:                         0x00F00000 */
/* Legacy compatibility: */
#define SQLITE_OPEN_MASTER_JOURNAL   0x00004000  /* VFS only */


/*
** CAPI3REF: Device Characteristics
**
** The xDeviceCharacteristics method of the [sqlite3_io_methods]
** object returns an integer which is a vector of these
** bit values expressing I/O characteristics of the mass storage
** device that holds the file that the [sqlite3_io_methods]
** refers to.
**
** The SQLITE_IOCAP_ATOMIC property means that all writes of
** any size are atomic.  The SQLITE_IOCAP_ATOMICnnn values
** mean that writes of blocks that are nnn bytes in size and
** are aligned to an address which is an integer multiple of
** nnn are atomic.  The SQLITE_IOCAP_SAFE_APPEND value means
** that when data is appended to a file, the data is appended
** first then the size of the file is extended, never the other
** way around.  The SQLITE_IOCAP_SEQUENTIAL property means that
** information is written to disk in the same order as calls
** to xWrite().  The SQLITE_IOCAP_POWERSAFE_OVERWRITE property means that
** after reboot following a crash or power loss, the only bytes in a
** file that were written at the application level might have changed
** and that adjacent bytes, even bytes within the same sector are
** guaranteed to be unchanged.  The SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN
** flag indicates that a file cannot be deleted when open.  The
** SQLITE_IOCAP_IMMUTABLE flag indicates that the file is on
** read-only media and cannot be changed even by processes with
** elevated privileges.
**
** The SQLITE_IOCAP_BATCH_ATOMIC property means that the underlying
** filesystem supports doing multiple write operations atomically when those
** write operations are bracketed by [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE] and
** [SQLITE_FCNTL_COMMIT_ATOMIC_WRITE].
**
** The SQLITE_IOCAP_SUBPAGE_READ property means that it is ok to read
** from the database file in amounts that are not a multiple of the
** page size and that do not begin at a page boundary.  Without this
** property, SQLite is careful to only do full-page reads and write
** on aligned pages, with the one exception that it will do a sub-page
** read of the first page to access the database header.
*/
#def
Download .txt
gitextract_57o27kni/

├── .codecov.yml
├── .github/
│   ├── FUNDING.yml
│   └── workflows/
│       ├── cifuzz.yaml
│       ├── docker.yaml
│       └── go.yaml
├── .gitignore
├── LICENSE
├── README.md
├── _example/
│   ├── custom_driver_name/
│   │   ├── Makefile
│   │   └── main.go
│   ├── custom_func/
│   │   └── main.go
│   ├── fuzz/
│   │   └── fuzz_openexec.go
│   ├── hook/
│   │   └── hook.go
│   ├── json/
│   │   └── json.go
│   ├── limit/
│   │   └── limit.go
│   ├── mod_regexp/
│   │   ├── Makefile
│   │   ├── extension.go
│   │   └── sqlite3_mod_regexp.c
│   ├── mod_vtable/
│   │   ├── Makefile
│   │   ├── extension.go
│   │   ├── picojson.h
│   │   └── sqlite3_mod_vtable.cc
│   ├── simple/
│   │   ├── Dockerfile
│   │   └── simple.go
│   ├── trace/
│   │   └── main.go
│   ├── vtable/
│   │   ├── main.go
│   │   └── vtable.go
│   └── vtable_eponymous_only/
│       ├── main.go
│       └── vtable.go
├── backup.go
├── backup_test.go
├── callback.go
├── callback_test.go
├── convert.go
├── doc.go
├── error.go
├── error_test.go
├── go.mod
├── go.sum
├── sqlite3-binding.c
├── sqlite3-binding.h
├── sqlite3.go
├── sqlite3_context.go
├── sqlite3_func_crypt.go
├── sqlite3_func_crypt_test.go
├── sqlite3_go113_test.go
├── sqlite3_go18.go
├── sqlite3_go18_test.go
├── sqlite3_libsqlite3.go
├── sqlite3_load_extension.go
├── sqlite3_load_extension_omit.go
├── sqlite3_load_extension_test.go
├── sqlite3_opt_allow_uri_authority.go
├── sqlite3_opt_app_armor.go
├── sqlite3_opt_column_metadata.go
├── sqlite3_opt_column_metadata_test.go
├── sqlite3_opt_foreign_keys.go
├── sqlite3_opt_fts3_test.go
├── sqlite3_opt_fts5.go
├── sqlite3_opt_icu.go
├── sqlite3_opt_introspect.go
├── sqlite3_opt_math_functions.go
├── sqlite3_opt_math_functions_test.go
├── sqlite3_opt_os_trace.go
├── sqlite3_opt_percentile.go
├── sqlite3_opt_preupdate.go
├── sqlite3_opt_preupdate_hook.go
├── sqlite3_opt_preupdate_hook_test.go
├── sqlite3_opt_preupdate_omit.go
├── sqlite3_opt_secure_delete.go
├── sqlite3_opt_secure_delete_fast.go
├── sqlite3_opt_serialize.go
├── sqlite3_opt_serialize_omit.go
├── sqlite3_opt_serialize_test.go
├── sqlite3_opt_stat4.go
├── sqlite3_opt_unlock_notify.c
├── sqlite3_opt_unlock_notify.go
├── sqlite3_opt_unlock_notify_test.go
├── sqlite3_opt_userauth.go
├── sqlite3_opt_userauth_omit.go
├── sqlite3_opt_userauth_test.go
├── sqlite3_opt_vacuum_full.go
├── sqlite3_opt_vacuum_incr.go
├── sqlite3_opt_vtable.go
├── sqlite3_opt_vtable_test.go
├── sqlite3_other.go
├── sqlite3_solaris.go
├── sqlite3_test.go
├── sqlite3_trace.go
├── sqlite3_type.go
├── sqlite3_usleep_windows.go
├── sqlite3_windows.go
├── sqlite3ext.h
├── static_mock.go
└── upgrade/
    ├── upgrade.go
    └── upgrade.sh
Download .txt
Showing preview only (513K chars total). Download the full file or copy to clipboard to get everything.
SYMBOL INDEX (5789 symbols across 61 files)

FILE: _example/custom_driver_name/main.go
  function main (line 9) | func main() {

FILE: _example/custom_func/main.go
  function pow (line 14) | func pow(x, y int64) int64 {
  function xor (line 19) | func xor(xs ...int64) int64 {
  function getrand (line 30) | func getrand() int64 {
  type stddev (line 35) | type stddev struct
    method Step (line 44) | func (s *stddev) Step(x int64) {
    method Done (line 50) | func (s *stddev) Done() float64 {
  function newStddev (line 42) | func newStddev() *stddev { return &stddev{} }
  function main (line 64) | func main() {

FILE: _example/fuzz/fuzz_openexec.go
  function FuzzOpenExec (line 11) | func FuzzOpenExec(data []byte) int {

FILE: _example/hook/hook.go
  function main (line 11) | func main() {

FILE: _example/json/json.go
  type Tag (line 13) | type Tag struct
    method Scan (line 18) | func (t *Tag) Scan(value interface{}) error {
    method Value (line 22) | func (t *Tag) Value() (driver.Value, error) {
  function main (line 27) | func main() {

FILE: _example/limit/limit.go
  function createBulkInsertQuery (line 13) | func createBulkInsertQuery(n int, start int) (query string, args []any) {
  function bulkInsert (line 30) | func bulkInsert(db *sql.DB, query string, args []any) (err error) {
  function main (line 44) | func main() {

FILE: _example/mod_regexp/extension.go
  function main (line 10) | func main() {

FILE: _example/mod_regexp/sqlite3_mod_regexp.c
  function SQLITE_EXTENSION_INIT1 (line 6) | SQLITE_EXTENSION_INIT1
  function sqlite3_extension_init (line 32) | int sqlite3_extension_init(sqlite3 *db, char **errmsg, const sqlite3_api...

FILE: _example/mod_vtable/extension.go
  function main (line 11) | func main() {

FILE: _example/mod_vtable/picojson.h
  function namespace (line 53) | namespace picojson {
  function class (line 613) | class deny_parse_context {
  function parse_array_stop (line 661) | bool parse_array_stop(size_t) { return true; }
  function parse_object_start (line 662) | bool parse_object_start() {
  function set_null (line 683) | bool set_null() { return true; }
  function set_bool (line 684) | bool set_bool(bool) { return true; }
  function set_number (line 685) | bool set_number(double) { return true; }
  function parse_array_start (line 690) | bool parse_array_start() { return true; }
  function parse_array_stop (line 694) | bool parse_array_stop(size_t) { return true; }
  function parse_object_start (line 695) | bool parse_object_start() { return true; }
  function std (line 734) | inline std::string parse(value& out, std::istream& is) {
  function set_last_error (line 746) | inline void set_last_error(const std::string& s) {
  function std (line 750) | inline const std::string& get_last_error() {
  function namespace (line 778) | namespace std {
  function plan (line 813) | static void plan(int num)
  function main (line 842) | int main(void)

FILE: _example/mod_vtable/sqlite3_mod_vtable.cc
  function MEMFILE (line 21) | MEMFILE*
  function memfclose (line 31) | void
  function memfwrite (line 37) | size_t
  function my_connect (line 63) | static int
  function my_create (line 74) | static int
  function my_disconnect (line 79) | static int my_disconnect(sqlite3_vtab *pVTab) {
  function my_destroy (line 84) | static int
  function my_open (line 96) | static int
  function my_close (line 142) | static int
  function my_filter (line 149) | static int
  function my_next (line 155) | static int
  function my_eof (line 161) | static int
  function my_column (line 166) | static int
  function my_rowid (line 189) | static int
  function my_bestindex (line 195) | static int
  function destructor (line 223) | static void
  function EXPORT (line 231) | EXPORT int

FILE: _example/simple/simple.go
  function main (line 11) | func main() {

FILE: _example/trace/main.go
  function traceCallback (line 12) | func traceCallback(info sqlite3.TraceInfo) int {
  function main (line 90) | func main() {
  function dbMain (line 117) | func dbMain() int {
  constant tableDDL (line 144) | tableDDL = `CREATE TABLE t1 (
  constant insertDML (line 151) | insertDML = "INSERT INTO t1 (note) VALUES (?)"
  constant selectDML (line 152) | selectDML = "SELECT id, note FROM t1 WHERE note LIKE ?"
  constant textPrefix (line 154) | textPrefix = "bla-1234567890-"
  constant noteTextPattern (line 155) | noteTextPattern = "%Prep%"
  constant nGenRows (line 157) | nGenRows = 4
  function dbSetup (line 159) | func dbSetup(db *sql.DB) {
  function dbDoInsert (line 172) | func dbDoInsert(db *sql.DB) {
  function dbDoInsertPrepared (line 184) | func dbDoInsertPrepared(db *sql.DB) {
  function resultDoCheck (line 203) | func resultDoCheck(result sql.Result, callerDescr string, callIndex int) {
  function dbDoSelect (line 216) | func dbDoSelect(db *sql.DB) {
  function dbDoSelectPrepared (line 228) | func dbDoSelectPrepared(db *sql.DB) {
  function rowsDoFetch (line 246) | func rowsDoFetch(rows *sql.Rows, callerDescr string) {

FILE: _example/vtable/main.go
  function main (line 11) | func main() {

FILE: _example/vtable/vtable.go
  type githubRepo (line 12) | type githubRepo struct
  type githubModule (line 19) | type githubModule struct
    method Create (line 22) | func (m *githubModule) Create(c *sqlite3.SQLiteConn, args []string) (s...
    method Connect (line 36) | func (m *githubModule) Connect(c *sqlite3.SQLiteConn, args []string) (...
    method DestroyModule (line 40) | func (m *githubModule) DestroyModule() {}
  type ghRepoTable (line 42) | type ghRepoTable struct
    method Open (line 46) | func (v *ghRepoTable) Open() (sqlite3.VTabCursor, error) {
    method BestIndex (line 65) | func (v *ghRepoTable) BestIndex(csts []sqlite3.InfoConstraint, ob []sq...
    method Disconnect (line 74) | func (v *ghRepoTable) Disconnect() error { return nil }
    method Destroy (line 75) | func (v *ghRepoTable) Destroy() error    { return nil }
  type ghRepoCursor (line 77) | type ghRepoCursor struct
    method Column (line 82) | func (vc *ghRepoCursor) Column(c *sqlite3.SQLiteContext, col int) error {
    method Filter (line 96) | func (vc *ghRepoCursor) Filter(idxNum int, idxStr string, vals []any) ...
    method Next (line 101) | func (vc *ghRepoCursor) Next() error {
    method EOF (line 106) | func (vc *ghRepoCursor) EOF() bool {
    method Rowid (line 110) | func (vc *ghRepoCursor) Rowid() (int64, error) {
    method Close (line 114) | func (vc *ghRepoCursor) Close() error {

FILE: _example/vtable_eponymous_only/main.go
  function main (line 11) | func main() {

FILE: _example/vtable_eponymous_only/vtable.go
  type seriesModule (line 9) | type seriesModule struct
    method EponymousOnlyModule (line 11) | func (m *seriesModule) EponymousOnlyModule() {}
    method Create (line 13) | func (m *seriesModule) Create(c *sqlite3.SQLiteConn, args []string) (s...
    method Connect (line 27) | func (m *seriesModule) Connect(c *sqlite3.SQLiteConn, args []string) (...
    method DestroyModule (line 31) | func (m *seriesModule) DestroyModule() {}
  type seriesTable (line 33) | type seriesTable struct
    method Open (line 39) | func (v *seriesTable) Open() (sqlite3.VTabCursor, error) {
    method BestIndex (line 43) | func (v *seriesTable) BestIndex(csts []sqlite3.InfoConstraint, ob []sq...
    method Disconnect (line 58) | func (v *seriesTable) Disconnect() error { return nil }
    method Destroy (line 59) | func (v *seriesTable) Destroy() error    { return nil }
  type seriesCursor (line 61) | type seriesCursor struct
    method Column (line 66) | func (vc *seriesCursor) Column(c *sqlite3.SQLiteContext, col int) error {
    method Filter (line 80) | func (vc *seriesCursor) Filter(idxNum int, idxStr string, vals []any) ...
    method Next (line 103) | func (vc *seriesCursor) Next() error {
    method EOF (line 108) | func (vc *seriesCursor) EOF() bool {
    method Rowid (line 112) | func (vc *seriesCursor) Rowid() (int64, error) {
    method Close (line 116) | func (vc *seriesCursor) Close() error {

FILE: backup.go
  type SQLiteBackup (line 23) | type SQLiteBackup struct
    method Step (line 46) | func (b *SQLiteBackup) Step(p int) (bool, error) {
    method Remaining (line 57) | func (b *SQLiteBackup) Remaining() int {
    method PageCount (line 62) | func (b *SQLiteBackup) PageCount() int {
    method Finish (line 67) | func (b *SQLiteBackup) Finish() error {
    method Close (line 72) | func (b *SQLiteBackup) Close() error {
  method Backup (line 28) | func (destConn *SQLiteConn) Backup(dest string, srcConn *SQLiteConn, src...

FILE: backup_test.go
  constant testRowCount (line 21) | testRowCount = 100
  constant usePagePerStepsTimeoutSeconds (line 24) | usePagePerStepsTimeoutSeconds = 30
  function testBackup (line 27) | func testBackup(t *testing.T, testRowCount int, usePerPageSteps bool) {
  function TestBackupStepByStep (line 246) | func TestBackupStepByStep(t *testing.T) {
  function TestBackupAllRemainingPages (line 250) | func TestBackupAllRemainingPages(t *testing.T) {
  function TestBackupError (line 255) | func TestBackupError(t *testing.T) {

FILE: callback.go
  function callbackTrampoline (line 36) | func callbackTrampoline(ctx *C.sqlite3_context, argc int, argv **C.sqlit...
  function stepTrampoline (line 43) | func stepTrampoline(ctx *C.sqlite3_context, argc C.int, argv **C.sqlite3...
  function doneTrampoline (line 50) | func doneTrampoline(ctx *C.sqlite3_context) {
  function compareTrampoline (line 56) | func compareTrampoline(handlePtr unsafe.Pointer, la C.int, a *C.char, lb...
  function commitHookTrampoline (line 62) | func commitHookTrampoline(handle unsafe.Pointer) int {
  function rollbackHookTrampoline (line 68) | func rollbackHookTrampoline(handle unsafe.Pointer) {
  function updateHookTrampoline (line 74) | func updateHookTrampoline(handle unsafe.Pointer, op int, db *C.char, tab...
  function authorizerTrampoline (line 80) | func authorizerTrampoline(handle unsafe.Pointer, op int, arg1 *C.char, a...
  function preUpdateHookTrampoline (line 86) | func preUpdateHookTrampoline(handle unsafe.Pointer, dbHandle uintptr, op...
  type handleVal (line 101) | type handleVal struct
  function newHandle (line 109) | func newHandle(db *SQLiteConn, v any) unsafe.Pointer {
  function lookupHandleVal (line 121) | func lookupHandleVal(handle unsafe.Pointer) handleVal {
  function lookupHandle (line 127) | func lookupHandle(handle unsafe.Pointer) any {
  function deleteHandles (line 131) | func deleteHandles(db *SQLiteConn) {
  type callbackArgRaw (line 143) | type callbackArgRaw
  type callbackArgConverter (line 145) | type callbackArgConverter
  type callbackArgCast (line 147) | type callbackArgCast struct
    method Run (line 152) | func (c callbackArgCast) Run(v *C.sqlite3_value) (reflect.Value, error) {
  function callbackArgInt64 (line 163) | func callbackArgInt64(v *C.sqlite3_value) (reflect.Value, error) {
  function callbackArgBool (line 170) | func callbackArgBool(v *C.sqlite3_value) (reflect.Value, error) {
  function callbackArgFloat64 (line 182) | func callbackArgFloat64(v *C.sqlite3_value) (reflect.Value, error) {
  function callbackArgBytes (line 189) | func callbackArgBytes(v *C.sqlite3_value) (reflect.Value, error) {
  function callbackArgString (line 204) | func callbackArgString(v *C.sqlite3_value) (reflect.Value, error) {
  function callbackArgGeneric (line 218) | func callbackArgGeneric(v *C.sqlite3_value) (reflect.Value, error) {
  function callbackArg (line 237) | func callbackArg(typ reflect.Type) (callbackArgConverter, error) {
  function callbackConvertArgs (line 268) | func callbackConvertArgs(argv []*C.sqlite3_value, converters []callbackA...
  type callbackRetConverter (line 295) | type callbackRetConverter
  function callbackRetInteger (line 297) | func callbackRetInteger(ctx *C.sqlite3_context, v reflect.Value) error {
  function callbackRetFloat (line 317) | func callbackRetFloat(ctx *C.sqlite3_context, v reflect.Value) error {
  function callbackRetBlob (line 330) | func callbackRetBlob(ctx *C.sqlite3_context, v reflect.Value) error {
  function callbackRetText (line 344) | func callbackRetText(ctx *C.sqlite3_context, v reflect.Value) error {
  function callbackRetNil (line 353) | func callbackRetNil(ctx *C.sqlite3_context, v reflect.Value) error {
  function callbackRetGeneric (line 357) | func callbackRetGeneric(ctx *C.sqlite3_context, v reflect.Value) error {
  function callbackRet (line 371) | func callbackRet(typ reflect.Type) (callbackRetConverter, error) {
  function callbackError (line 400) | func callbackError(ctx *C.sqlite3_context, err error) {
  function callbackSyntheticForTests (line 408) | func callbackSyntheticForTests(v reflect.Value, err error) callbackArgCo...

FILE: callback_test.go
  function TestCallbackArgCast (line 18) | func TestCallbackArgCast(t *testing.T) {
  function TestCallbackConverters (line 55) | func TestCallbackConverters(t *testing.T) {
  function TestCallbackReturnAny (line 107) | func TestCallbackReturnAny(t *testing.T) {

FILE: convert.go
  function convertAssign (line 26) | func convertAssign(dest, src any) error {
  function strconvErr (line 243) | func strconvErr(err error) error {
  function cloneBytes (line 250) | func cloneBytes(b []byte) []byte {
  function asString (line 259) | func asString(src any) string {
  function asBytes (line 282) | func asBytes(buf []byte, rv reflect.Value) (b []byte, ok bool) {

FILE: error.go
  type ErrNo (line 19) | type ErrNo
    method Error (line 69) | func (err ErrNo) Error() string {
    method Extend (line 74) | func (err ErrNo) Extend(by int) ErrNoExtended {
  constant ErrNoMask (line 22) | ErrNoMask C.int = 0xff
  type ErrNoExtended (line 25) | type ErrNoExtended
    method Error (line 79) | func (err ErrNoExtended) Error() string {
  type Error (line 28) | type Error struct
    method Error (line 83) | func (err Error) Error() string {

FILE: error_test.go
  function TestSimpleError (line 19) | func TestSimpleError(t *testing.T) {
  function TestCorruptDbErrors (line 26) | func TestCorruptDbErrors(t *testing.T) {
  function TestSqlLogicErrors (line 59) | func TestSqlLogicErrors(t *testing.T) {
  function TestExtendedErrorCodes_ForeignKey (line 86) | func TestExtendedErrorCodes_ForeignKey(t *testing.T) {
  function TestExtendedErrorCodes_NotNull (line 132) | func TestExtendedErrorCodes_NotNull(t *testing.T) {
  function TestExtendedErrorCodes_Unique (line 188) | func TestExtendedErrorCodes_Unique(t *testing.T) {
  function TestError_SystemErrno (line 249) | func TestError_SystemErrno(t *testing.T) {

FILE: sqlite3-binding.c
  type sqlite3 (line 597) | typedef struct sqlite3 sqlite3;
  type SQLITE_INT64_TYPE (line 616) | typedef SQLITE_INT64_TYPE sqlite_int64;
  type SQLITE_UINT64_TYPE (line 618) | typedef SQLITE_UINT64_TYPE sqlite_uint64;
  type sqlite_uint64 (line 620) | typedef unsigned SQLITE_INT64_TYPE sqlite_uint64;
  type __int64 (line 623) | typedef __int64 sqlite_int64;
  type sqlite_uint64 (line 624) | typedef unsigned __int64 sqlite_uint64;
  type sqlite_int64 (line 626) | typedef long long int sqlite_int64;
  type sqlite_uint64 (line 627) | typedef unsigned long long int sqlite_uint64;
  type sqlite_int64 (line 629) | typedef sqlite_int64 sqlite3_int64;
  type sqlite_uint64 (line 630) | typedef sqlite_uint64 sqlite3_uint64;
  type sqlite3_file (line 1068) | typedef struct sqlite3_file sqlite3_file;
  type sqlite3_file (line 1069) | struct sqlite3_file {
  type sqlite3_io_methods (line 1175) | typedef struct sqlite3_io_methods sqlite3_io_methods;
  type sqlite3_io_methods (line 1176) | struct sqlite3_io_methods {
  type sqlite3_mutex (line 1626) | typedef struct sqlite3_mutex sqlite3_mutex;
  type sqlite3_api_routines (line 1636) | typedef struct sqlite3_api_routines sqlite3_api_routines;
  type sqlite3_vfs (line 1827) | typedef struct sqlite3_vfs sqlite3_vfs;
  type sqlite3_vfs (line 1829) | struct sqlite3_vfs {
  type sqlite3_mem_methods (line 2128) | typedef struct sqlite3_mem_methods sqlite3_mem_methods;
  type sqlite3_mem_methods (line 2129) | struct sqlite3_mem_methods {
  type sqlite3_stmt (line 4593) | typedef struct sqlite3_stmt sqlite3_stmt;
  type sqlite3_value (line 5111) | typedef struct sqlite3_value sqlite3_value;
  type sqlite3_context (line 5125) | typedef struct sqlite3_context sqlite3_context;
  type sqlite3_vtab (line 7873) | typedef struct sqlite3_vtab sqlite3_vtab;
  type sqlite3_index_info (line 7874) | typedef struct sqlite3_index_info sqlite3_index_info;
  type sqlite3_vtab_cursor (line 7875) | typedef struct sqlite3_vtab_cursor sqlite3_vtab_cursor;
  type sqlite3_module (line 7876) | typedef struct sqlite3_module sqlite3_module;
  type sqlite3_module (line 7894) | struct sqlite3_module {
  type sqlite3_index_info (line 8040) | struct sqlite3_index_info {
  type sqlite3_vtab (line 8220) | struct sqlite3_vtab {
  type sqlite3_vtab_cursor (line 8244) | struct sqlite3_vtab_cursor {
  type sqlite3_blob (line 8290) | typedef struct sqlite3_blob sqlite3_blob;
  type sqlite3_mutex_methods (line 8740) | typedef struct sqlite3_mutex_methods sqlite3_mutex_methods;
  type sqlite3_mutex_methods (line 8741) | struct sqlite3_mutex_methods {
  type sqlite3_str (line 9008) | typedef struct sqlite3_str sqlite3_str;
  type sqlite3_pcache (line 9529) | typedef struct sqlite3_pcache sqlite3_pcache;
  type sqlite3_pcache_page (line 9541) | typedef struct sqlite3_pcache_page sqlite3_pcache_page;
  type sqlite3_pcache_page (line 9542) | struct sqlite3_pcache_page {
  type sqlite3_pcache_methods2 (line 9706) | typedef struct sqlite3_pcache_methods2 sqlite3_pcache_methods2;
  type sqlite3_pcache_methods2 (line 9707) | struct sqlite3_pcache_methods2 {
  type sqlite3_pcache_methods (line 9729) | typedef struct sqlite3_pcache_methods sqlite3_pcache_methods;
  type sqlite3_pcache_methods (line 9730) | struct sqlite3_pcache_methods {
  type sqlite3_backup (line 9755) | typedef struct sqlite3_backup sqlite3_backup;
  type sqlite3_snapshot (line 11155) | typedef struct sqlite3_snapshot {
  type sqlite3_rtree_geometry (line 11572) | typedef struct sqlite3_rtree_geometry sqlite3_rtree_geometry;
  type sqlite3_rtree_query_info (line 11573) | typedef struct sqlite3_rtree_query_info sqlite3_rtree_query_info;
  type sqlite3_int64 (line 11579) | typedef sqlite3_int64 sqlite3_rtree_dbl;
  type sqlite3_rtree_dbl (line 11581) | typedef double sqlite3_rtree_dbl;
  type sqlite3_rtree_geometry (line 11602) | struct sqlite3_rtree_geometry {
  type sqlite3_rtree_query_info (line 11634) | struct sqlite3_rtree_query_info {
  type sqlite3_session (line 11688) | typedef struct sqlite3_session sqlite3_session;
  type sqlite3_changeset_iter (line 11696) | typedef struct sqlite3_changeset_iter sqlite3_changeset_iter;
  type sqlite3_changegroup (line 12562) | typedef struct sqlite3_changegroup sqlite3_changegroup;
  type sqlite3_rebaser (line 13237) | typedef struct sqlite3_rebaser sqlite3_rebaser;
  type Fts5ExtensionApi (line 13570) | typedef struct Fts5ExtensionApi Fts5ExtensionApi;
  type Fts5Context (line 13571) | typedef struct Fts5Context Fts5Context;
  type Fts5PhraseIter (line 13572) | typedef struct Fts5PhraseIter Fts5PhraseIter;
  type Fts5PhraseIter (line 13582) | struct Fts5PhraseIter {
  type Fts5ExtensionApi (line 13883) | struct Fts5ExtensionApi {
  type Fts5Tokenizer (line 14164) | typedef struct Fts5Tokenizer Fts5Tokenizer;
  type fts5_tokenizer_v2 (line 14165) | typedef struct fts5_tokenizer_v2 fts5_tokenizer_v2;
  type fts5_tokenizer_v2 (line 14166) | struct fts5_tokenizer_v2 {
  type fts5_tokenizer (line 14192) | typedef struct fts5_tokenizer fts5_tokenizer;
  type fts5_tokenizer (line 14193) | struct fts5_tokenizer {
  type fts5_api (line 14229) | typedef struct fts5_api fts5_api;
  type fts5_api (line 14230) | struct fts5_api {
  type Hash (line 14993) | typedef struct Hash Hash;
  type HashElem (line 14994) | typedef struct HashElem HashElem;
  type Hash (line 15017) | struct Hash {
  type HashElem (line 15033) | struct HashElem {
  type sqlite_int64 (line 15478) | typedef sqlite_int64 i64;
  type sqlite_uint64 (line 15479) | typedef sqlite_uint64 u64;
  type UINT32_TYPE (line 15480) | typedef UINT32_TYPE u32;
  type UINT16_TYPE (line 15481) | typedef UINT16_TYPE u16;
  type INT16_TYPE (line 15482) | typedef INT16_TYPE i16;
  type UINT8_TYPE (line 15483) | typedef UINT8_TYPE u8;
  type INT8_TYPE (line 15484) | typedef INT8_TYPE i8;
  type bft (line 15489) | typedef unsigned bft;
  type u64 (line 15503) | typedef u64 tRowcnt;
  type INT16_TYPE (line 15528) | typedef INT16_TYPE LogEst;
  type uptr (line 15551) | typedef uintptr_t uptr;
  type u32 (line 15553) | typedef u32 uptr;
  type u64 (line 15555) | typedef u64 uptr;
  type BusyHandler (line 15845) | typedef struct BusyHandler BusyHandler;
  type BusyHandler (line 15846) | struct BusyHandler {
  type AggInfo (line 15955) | typedef struct AggInfo AggInfo;
  type AuthContext (line 15956) | typedef struct AuthContext AuthContext;
  type AutoincInfo (line 15957) | typedef struct AutoincInfo AutoincInfo;
  type Bitvec (line 15958) | typedef struct Bitvec Bitvec;
  type CollSeq (line 15959) | typedef struct CollSeq CollSeq;
  type Column (line 15960) | typedef struct Column Column;
  type Cte (line 15961) | typedef struct Cte Cte;
  type CteUse (line 15962) | typedef struct CteUse CteUse;
  type Db (line 15963) | typedef struct Db Db;
  type DbClientData (line 15964) | typedef struct DbClientData DbClientData;
  type DbFixer (line 15965) | typedef struct DbFixer DbFixer;
  type Schema (line 15966) | typedef struct Schema Schema;
  type Expr (line 15967) | typedef struct Expr Expr;
  type ExprList (line 15968) | typedef struct ExprList ExprList;
  type FKey (line 15969) | typedef struct FKey FKey;
  type FpDecode (line 15970) | typedef struct FpDecode FpDecode;
  type FuncDestructor (line 15971) | typedef struct FuncDestructor FuncDestructor;
  type FuncDef (line 15972) | typedef struct FuncDef FuncDef;
  type FuncDefHash (line 15973) | typedef struct FuncDefHash FuncDefHash;
  type IdList (line 15974) | typedef struct IdList IdList;
  type Index (line 15975) | typedef struct Index Index;
  type IndexedExpr (line 15976) | typedef struct IndexedExpr IndexedExpr;
  type IndexSample (line 15977) | typedef struct IndexSample IndexSample;
  type KeyClass (line 15978) | typedef struct KeyClass KeyClass;
  type KeyInfo (line 15979) | typedef struct KeyInfo KeyInfo;
  type Lookaside (line 15980) | typedef struct Lookaside Lookaside;
  type LookasideSlot (line 15981) | typedef struct LookasideSlot LookasideSlot;
  type Module (line 15982) | typedef struct Module Module;
  type NameContext (line 15983) | typedef struct NameContext NameContext;
  type OnOrUsing (line 15984) | typedef struct OnOrUsing OnOrUsing;
  type Parse (line 15985) | typedef struct Parse Parse;
  type ParseCleanup (line 15986) | typedef struct ParseCleanup ParseCleanup;
  type PreUpdate (line 15987) | typedef struct PreUpdate PreUpdate;
  type PrintfArguments (line 15988) | typedef struct PrintfArguments PrintfArguments;
  type RCStr (line 15989) | typedef struct RCStr RCStr;
  type RenameToken (line 15990) | typedef struct RenameToken RenameToken;
  type Returning (line 15991) | typedef struct Returning Returning;
  type RowSet (line 15992) | typedef struct RowSet RowSet;
  type Savepoint (line 15993) | typedef struct Savepoint Savepoint;
  type Select (line 15994) | typedef struct Select Select;
  type SQLiteThread (line 15995) | typedef struct SQLiteThread SQLiteThread;
  type SelectDest (line 15996) | typedef struct SelectDest SelectDest;
  type Subquery (line 15997) | typedef struct Subquery Subquery;
  type SrcItem (line 15998) | typedef struct SrcItem SrcItem;
  type SrcList (line 15999) | typedef struct SrcList SrcList;
  type StrAccum (line 16000) | typedef struct sqlite3_str StrAccum;
  type Table (line 16001) | typedef struct Table Table;
  type TableLock (line 16002) | typedef struct TableLock TableLock;
  type Token (line 16003) | typedef struct Token Token;
  type TreeView (line 16004) | typedef struct TreeView TreeView;
  type Trigger (line 16005) | typedef struct Trigger Trigger;
  type TriggerPrg (line 16006) | typedef struct TriggerPrg TriggerPrg;
  type TriggerStep (line 16007) | typedef struct TriggerStep TriggerStep;
  type UnpackedRecord (line 16008) | typedef struct UnpackedRecord UnpackedRecord;
  type Upsert (line 16009) | typedef struct Upsert Upsert;
  type VTable (line 16010) | typedef struct VTable VTable;
  type VtabCtx (line 16011) | typedef struct VtabCtx VtabCtx;
  type Walker (line 16012) | typedef struct Walker Walker;
  type WhereInfo (line 16013) | typedef struct WhereInfo WhereInfo;
  type Window (line 16014) | typedef struct Window Window;
  type With (line 16015) | typedef struct With With;
  type SQLITE_BITMASK_TYPE (line 16026) | typedef SQLITE_BITMASK_TYPE Bitmask;
  type u64 (line 16028) | typedef u64 Bitmask;
  type VList (line 16052) | typedef int VList;
  type u32 (line 16418) | typedef u32 Pgno;
  type Pager (line 16423) | typedef struct Pager Pager;
  type DbPage (line 16428) | typedef struct PgHdr DbPage;
  type Btree (line 16692) | typedef struct Btree Btree;
  type BtCursor (line 16693) | typedef struct BtCursor BtCursor;
  type BtShared (line 16694) | typedef struct BtShared BtShared;
  type BtreePayload (line 16695) | typedef struct BtreePayload BtreePayload;
  type KeyInfo (line 16891) | struct KeyInfo
  type BtreePayload (line 16960) | struct BtreePayload {
  type Vdbe (line 17110) | typedef struct Vdbe Vdbe;
  type Mem (line 17116) | typedef struct sqlite3_value Mem;
  type SubProgram (line 17117) | typedef struct SubProgram SubProgram;
  type SubrtnSig (line 17118) | typedef struct SubrtnSig SubrtnSig;
  type SubrtnSig (line 17124) | struct SubrtnSig {
  type VdbeOp (line 17138) | struct VdbeOp {
  type VdbeOp (line 17177) | typedef struct VdbeOp VdbeOp;
  type SubProgram (line 17183) | struct SubProgram {
  type VdbeOpList (line 17197) | struct VdbeOpList {
  type VdbeOpList (line 17203) | typedef struct VdbeOpList VdbeOpList;
  type PgHdr (line 17783) | typedef struct PgHdr PgHdr;
  type PCache (line 17784) | typedef struct PCache PCache;
  type PgHdr (line 17790) | struct PgHdr {
  type Db (line 18074) | struct Db {
  type Schema (line 18099) | struct Schema {
  type Lookaside (line 18187) | struct Lookaside {
  type LookasideSlot (line 18206) | struct LookasideSlot {
  type FuncDefHash (line 18230) | struct FuncDefHash {
  type sqlite3 (line 18262) | struct sqlite3 {
  type FuncDef (line 18567) | struct FuncDef {
  type FuncDestructor (line 18597) | struct FuncDestructor {
  type Savepoint (line 18789) | struct Savepoint {
  type Module (line 18810) | struct Module {
  type Column (line 18844) | struct Column {
  type CollSeq (line 18901) | struct CollSeq {
  type VTable (line 19002) | struct VTable {
  type Table (line 19024) | struct Table {
  type FKey (line 19183) | struct FKey {
  type KeyInfo (line 19264) | struct KeyInfo {
  type UnpackedRecord (line 19326) | struct UnpackedRecord {
  type Index (line 19389) | struct Index {
  type IndexSample (line 19455) | struct IndexSample {
  type Token (line 19479) | struct Token {
  type AggInfo (line 19497) | struct AggInfo {
  type i16 (line 19563) | typedef i16 ynVar;
  type ynVar (line 19565) | typedef int ynVar;
  type Expr (line 19631) | struct Expr {
  type ExprList (line 19831) | struct ExprList {
  type IdList (line 19888) | struct IdList {
  type Subquery (line 19909) | struct Subquery {
  type SrcItem (line 19953) | struct SrcItem {
  type OnOrUsing (line 20005) | struct OnOrUsing {
  type SrcList (line 20017) | struct SrcList {
  type NameContext (line 20098) | struct NameContext {
  type Upsert (line 20162) | struct Upsert {
  type Select (line 20202) | struct Select {
  type SelectDest (line 20374) | struct SelectDest {
  type AutoincInfo (line 20393) | struct AutoincInfo {
  type TriggerPrg (line 20418) | struct TriggerPrg {
  type yDbMask (line 20437) | typedef unsigned int yDbMask;
  type IndexedExpr (line 20455) | struct IndexedExpr {
  type ParseCleanup (line 20473) | struct ParseCleanup {
  type Parse (line 20495) | struct Parse {
  type AuthContext (line 20659) | struct AuthContext {
  type Trigger (line 20713) | struct Trigger {
  type TriggerStep (line 20781) | struct TriggerStep {
  type Returning (line 20801) | struct Returning {
  type sqlite3_str (line 20816) | struct sqlite3_str {
  type RCStr (line 20849) | struct RCStr {
  type InitData (line 20858) | typedef struct {
  type Sqlite3Config (line 20897) | struct Sqlite3Config {
  type Walker (line 20992) | struct Walker {
  type DbFixer (line 21028) | struct DbFixer {
  type Cte (line 21073) | struct Cte {
  type With (line 21093) | struct With {
  type CteUse (line 21115) | struct CteUse {
  type DbClientData (line 21128) | struct DbClientData {
  type TreeView (line 21144) | struct TreeView {
  type Window (line 21173) | struct Window {
  type PrintfArguments (line 21431) | struct PrintfArguments {
  type FpDecode (line 21441) | struct FpDecode {
  type Sqlite3Config (line 22042) | struct Sqlite3Config
  type ExprList_item (line 22065) | struct ExprList_item
  function local_ioerr (line 22570) | static void local_ioerr(){
  function SQLITE_PRIVATE (line 23411) | SQLITE_PRIVATE const char **sqlite3CompileOptions(int *pnOpt){
  type Sqlite3Config (line 23657) | struct Sqlite3Config
  type Op (line 23887) | typedef struct VdbeOp Op;
  type Bool (line 23892) | typedef unsigned Bool;
  type VdbeSorter (line 23895) | typedef struct VdbeSorter VdbeSorter;
  type AuxData (line 23898) | typedef struct AuxData AuxData;
  type VdbeTxtBlbCache (line 23901) | typedef struct VdbeTxtBlbCache VdbeTxtBlbCache;
  type VdbeCursor (line 23919) | typedef struct VdbeCursor VdbeCursor;
  type VdbeCursor (line 23920) | struct VdbeCursor {
  type VdbeTxtBlbCache (line 24006) | struct VdbeTxtBlbCache {
  type VdbeFrame (line 24035) | typedef struct VdbeFrame VdbeFrame;
  type VdbeFrame (line 24036) | struct VdbeFrame {
  type sqlite3_value (line 24073) | struct sqlite3_value {
  type AuxData (line 24215) | struct AuxData {
  type sqlite3_context (line 24236) | struct sqlite3_context {
  type ScanStatus (line 24268) | typedef struct ScanStatus ScanStatus;
  type ScanStatus (line 24269) | struct ScanStatus {
  type DblquoteStr (line 24286) | typedef struct DblquoteStr DblquoteStr;
  type DblquoteStr (line 24287) | struct DblquoteStr {
  type Vdbe (line 24299) | struct Vdbe {
  type PreUpdate (line 24384) | struct PreUpdate {
  type ValueList (line 24418) | typedef struct ValueList ValueList;
  type ValueList (line 24419) | struct ValueList {
  type sqlite3_int64 (line 24600) | typedef sqlite3_int64 sqlite3StatValueType;
  type u32 (line 24602) | typedef u32 sqlite3StatValueType;
  type sqlite3StatType (line 24604) | typedef struct sqlite3StatType sqlite3StatType;
  function SQLITE_WSD (line 24605) | static SQLITE_WSD struct sqlite3StatType {
  function SQLITE_PRIVATE (line 24646) | SQLITE_PRIVATE sqlite3_int64 sqlite3StatusValue(int op){
  function SQLITE_PRIVATE (line 24666) | SQLITE_PRIVATE void sqlite3StatusUp(int op, int N){
  function SQLITE_PRIVATE (line 24677) | SQLITE_PRIVATE void sqlite3StatusDown(int op, int N){
  function SQLITE_PRIVATE (line 24691) | SQLITE_PRIVATE void sqlite3StatusHighwater(int op, int X){
  function SQLITE_API (line 24711) | SQLITE_API int sqlite3_status64(
  function SQLITE_API (line 24736) | SQLITE_API int sqlite3_status(int op, int *pCurrent, int *pHighwater, in...
  function u32 (line 24753) | static u32 countLookasideSlots(LookasideSlot *p){
  function SQLITE_PRIVATE (line 24765) | SQLITE_PRIVATE int sqlite3LookasideUsed(sqlite3 *db, int *pHighwater){
  function SQLITE_API (line 24780) | SQLITE_API int sqlite3_db_status64(
  function SQLITE_API (line 25003) | SQLITE_API int sqlite3_db_status(
  type tm (line 25086) | struct tm
  type DateTime (line 25092) | typedef struct DateTime DateTime;
  type DateTime (line 25093) | struct DateTime {
  function getDigits (line 25138) | static int getDigits(const char *zDate, const char *zFormat, ...){
  function parseTimezone (line 25192) | static int parseTimezone(const char *zDate, DateTime *p){
  function parseHhMmSs (line 25233) | static int parseHhMmSs(const char *zDate, DateTime *p){
  function datetimeError (line 25275) | static void datetimeError(DateTime *p){
  function computeJD (line 25286) | static void computeJD(DateTime *p){
  function computeFloor (line 25332) | static void computeFloor(DateTime *p){
  function parseYyyyMmDd (line 25361) | static int parseYyyyMmDd(const char *zDate, DateTime *p){
  function setDateTimeToCurrent (line 25402) | static int setDateTimeToCurrent(sqlite3_context *context, DateTime *p){
  function setRawDateNumber (line 25421) | static void setRawDateNumber(DateTime *p, double r){
  function parseDateOrTime (line 25446) | static int parseDateOrTime(
  function validJulianDay (line 25484) | static int validJulianDay(sqlite3_int64 iJD){
  function computeYMD (line 25491) | static void computeYMD(DateTime *p){
  function computeHMS (line 25520) | static void computeHMS(DateTime *p){
  function computeYMD_HMS (line 25536) | static void computeYMD_HMS(DateTime *p){
  function clearYMD_HMS_TZ (line 25544) | static void clearYMD_HMS_TZ(DateTime *p){
  function osLocaltime (line 25584) | static int osLocaltime(time_t *t, struct tm *pTm){
  function toLocaltime (line 25634) | static int toLocaltime(
  function autoAdjustDate (line 25712) | static void autoAdjustDate(DateTime *p){
  function parseModifier (line 25756) | static int parseModifier(
  function isDate (line 26127) | static int isDate(
  function juliandayFunc (line 26177) | static void juliandayFunc(
  function unixepochFunc (line 26195) | static void unixepochFunc(
  function datetimeFunc (line 26216) | static void datetimeFunc(
  function timeFunc (line 26276) | static void timeFunc(
  function dateFunc (line 26318) | static void dateFunc(
  function daysAfterJan01 (line 26359) | static int daysAfterJan01(DateTime *pDate){
  function daysAfterMonday (line 26379) | static int daysAfterMonday(DateTime *pDate){
  function daysAfterSunday (line 26392) | static int daysAfterSunday(DateTime *pDate){
  function strftimeFunc (line 26430) | static void strftimeFunc(
  function ctimeFunc (line 26598) | static void ctimeFunc(
  function cdateFunc (line 26612) | static void cdateFunc(
  function timediffFunc (line 26638) | static void timediffFunc(
  function ctimestampFunc (line 26735) | static void ctimestampFunc(
  function currentTimeFunc (line 26757) | static void currentTimeFunc(
  function datedebugFunc (line 26797) | static void datedebugFunc(
  function SQLITE_PRIVATE (line 26825) | SQLITE_PRIVATE void sqlite3RegisterDateTimeFunctions(void){
  function SQLITE_PRIVATE (line 26933) | SQLITE_PRIVATE void sqlite3OsClose(sqlite3_file *pId){
  function SQLITE_PRIVATE (line 26939) | SQLITE_PRIVATE int sqlite3OsRead(sqlite3_file *id, void *pBuf, int amt, ...
  function SQLITE_PRIVATE (line 26943) | SQLITE_PRIVATE int sqlite3OsWrite(sqlite3_file *id, const void *pBuf, in...
  function SQLITE_PRIVATE (line 26947) | SQLITE_PRIVATE int sqlite3OsTruncate(sqlite3_file *id, i64 size){
  function SQLITE_PRIVATE (line 26950) | SQLITE_PRIVATE int sqlite3OsSync(sqlite3_file *id, int flags){
  function SQLITE_PRIVATE (line 26954) | SQLITE_PRIVATE int sqlite3OsFileSize(sqlite3_file *id, i64 *pSize){
  function SQLITE_PRIVATE (line 26958) | SQLITE_PRIVATE int sqlite3OsLock(sqlite3_file *id, int lockType){
  function SQLITE_PRIVATE (line 26963) | SQLITE_PRIVATE int sqlite3OsUnlock(sqlite3_file *id, int lockType){
  function SQLITE_PRIVATE (line 26967) | SQLITE_PRIVATE int sqlite3OsCheckReservedLock(sqlite3_file *id, int *pRe...
  function SQLITE_PRIVATE (line 26980) | SQLITE_PRIVATE int sqlite3OsFileControl(sqlite3_file *id, int op, void *...
  function SQLITE_PRIVATE (line 27008) | SQLITE_PRIVATE void sqlite3OsFileControlHint(sqlite3_file *id, int op, v...
  function SQLITE_PRIVATE (line 27012) | SQLITE_PRIVATE int sqlite3OsSectorSize(sqlite3_file *id){
  function SQLITE_PRIVATE (line 27016) | SQLITE_PRIVATE int sqlite3OsDeviceCharacteristics(sqlite3_file *id){
  function SQLITE_PRIVATE (line 27021) | SQLITE_PRIVATE int sqlite3OsShmLock(sqlite3_file *id, int offset, int n,...
  function SQLITE_PRIVATE (line 27024) | SQLITE_PRIVATE void sqlite3OsShmBarrier(sqlite3_file *id){
  function SQLITE_PRIVATE (line 27027) | SQLITE_PRIVATE int sqlite3OsShmUnmap(sqlite3_file *id, int deleteFlag){
  function SQLITE_PRIVATE (line 27030) | SQLITE_PRIVATE int sqlite3OsShmMap(
  function SQLITE_PRIVATE (line 27044) | SQLITE_PRIVATE int sqlite3OsFetch(sqlite3_file *id, i64 iOff, int iAmt, ...
  function SQLITE_PRIVATE (line 27048) | SQLITE_PRIVATE int sqlite3OsUnfetch(sqlite3_file *id, i64 iOff, void *p){
  function SQLITE_PRIVATE (line 27053) | SQLITE_PRIVATE int sqlite3OsFetch(sqlite3_file *id, i64 iOff, int iAmt, ...
  function SQLITE_PRIVATE (line 27057) | SQLITE_PRIVATE int sqlite3OsUnfetch(sqlite3_file *id, i64 iOff, void *p){
  function SQLITE_PRIVATE (line 27066) | SQLITE_PRIVATE int sqlite3OsOpen(
  function SQLITE_PRIVATE (line 27084) | SQLITE_PRIVATE int sqlite3OsDelete(sqlite3_vfs *pVfs, const char *zPath,...
  function SQLITE_PRIVATE (line 27089) | SQLITE_PRIVATE int sqlite3OsAccess(
  function SQLITE_PRIVATE (line 27098) | SQLITE_PRIVATE int sqlite3OsFullPathname(
  function SQLITE_PRIVATE (line 27109) | SQLITE_PRIVATE void *sqlite3OsDlOpen(sqlite3_vfs *pVfs, const char *zPath){
  function SQLITE_PRIVATE (line 27114) | SQLITE_PRIVATE void sqlite3OsDlError(sqlite3_vfs *pVfs, int nByte, char ...
  function SQLITE_PRIVATE (line 27117) | SQLITE_PRIVATE void (*sqlite3OsDlSym(sqlite3_vfs *pVfs, void *pHdle, con...
  function SQLITE_PRIVATE (line 27120) | SQLITE_PRIVATE void sqlite3OsDlClose(sqlite3_vfs *pVfs, void *pHandle){
  function SQLITE_PRIVATE (line 27124) | SQLITE_PRIVATE int sqlite3OsRandomness(sqlite3_vfs *pVfs, int nByte, cha...
  function SQLITE_PRIVATE (line 27135) | SQLITE_PRIVATE int sqlite3OsSleep(sqlite3_vfs *pVfs, int nMicro){
  function SQLITE_PRIVATE (line 27138) | SQLITE_PRIVATE int sqlite3OsGetLastError(sqlite3_vfs *pVfs){
  function SQLITE_PRIVATE (line 27141) | SQLITE_PRIVATE int sqlite3OsCurrentTimeInt64(sqlite3_vfs *pVfs, sqlite3_...
  function SQLITE_PRIVATE (line 27159) | SQLITE_PRIVATE int sqlite3OsOpenMalloc(
  function SQLITE_PRIVATE (line 27184) | SQLITE_PRIVATE void sqlite3OsCloseFree(sqlite3_file *pFile){
  function SQLITE_PRIVATE (line 27196) | SQLITE_PRIVATE int sqlite3OsInit(void){
  function SQLITE_API (line 27213) | SQLITE_API sqlite3_vfs *sqlite3_vfs_find(const char *zVfs){
  function vfsUnlink (line 27237) | static void vfsUnlink(sqlite3_vfs *pVfs){
  function SQLITE_API (line 27259) | SQLITE_API int sqlite3_vfs_register(sqlite3_vfs *pVfs, int makeDflt){
  function SQLITE_API (line 27287) | SQLITE_API int sqlite3_vfs_unregister(sqlite3_vfs *pVfs){
  type BenignMallocHooks (line 27335) | typedef struct BenignMallocHooks BenignMallocHooks;
  function SQLITE_WSD (line 27336) | static SQLITE_WSD struct BenignMallocHooks {
  function SQLITE_PRIVATE (line 27361) | SQLITE_PRIVATE void sqlite3BenignMallocHooks(
  function SQLITE_PRIVATE (line 27375) | SQLITE_PRIVATE void sqlite3BeginBenignMalloc(void){
  function SQLITE_PRIVATE (line 27381) | SQLITE_PRIVATE void sqlite3EndBenignMalloc(void){
  function sqlite3MemFree (line 27423) | static void sqlite3MemFree(void *pPrior){ return; }
  function sqlite3MemSize (line 27425) | static int sqlite3MemSize(void *pPrior){ return 0; }
  function sqlite3MemRoundup (line 27426) | static int sqlite3MemRoundup(int n){ return n; }
  function sqlite3MemInit (line 27427) | static int sqlite3MemInit(void *NotUsed){ return SQLITE_OK; }
  function sqlite3MemShutdown (line 27428) | static void sqlite3MemShutdown(void *NotUsed){ return; }
  function SQLITE_PRIVATE (line 27436) | SQLITE_PRIVATE void sqlite3MemSetDefault(void){
  function sqlite3MemFree (line 27615) | static void sqlite3MemFree(void *pPrior){
  function sqlite3MemSize (line 27630) | static int sqlite3MemSize(void *pPrior){
  function sqlite3MemRoundup (line 27685) | static int sqlite3MemRoundup(int n){
  function sqlite3MemInit (line 27692) | static int sqlite3MemInit(void *NotUsed){
  function sqlite3MemShutdown (line 27719) | static void sqlite3MemShutdown(void *NotUsed){
  function SQLITE_PRIVATE (line 27730) | SQLITE_PRIVATE void sqlite3MemSetDefault(void){
  type MemBlockHdr (line 27802) | struct MemBlockHdr {
  type MemBlockHdr (line 27839) | struct MemBlockHdr
  type MemBlockHdr (line 27840) | struct MemBlockHdr
  function adjustStats (line 27876) | static void adjustStats(int iSize, int increment){
  type MemBlockHdr (line 27899) | struct MemBlockHdr
  type MemBlockHdr (line 27900) | struct MemBlockHdr
  type MemBlockHdr (line 27905) | struct MemBlockHdr
  function sqlite3MemSize (line 27923) | static int sqlite3MemSize(void *p){
  function sqlite3MemInit (line 27935) | static int sqlite3MemInit(void *NotUsed){
  function sqlite3MemShutdown (line 27949) | static void sqlite3MemShutdown(void *NotUsed){
  function sqlite3MemRoundup (line 27957) | static int sqlite3MemRoundup(int n){
  function randomFill (line 27966) | static void randomFill(char *pBuf, int nByte){
  type MemBlockHdr (line 27990) | struct MemBlockHdr
  type MemBlockHdr (line 28006) | struct MemBlockHdr
  function sqlite3MemFree (line 28048) | static void sqlite3MemFree(void *pPrior){
  type MemBlockHdr (line 28091) | struct MemBlockHdr
  function SQLITE_PRIVATE (line 28111) | SQLITE_PRIVATE void sqlite3MemSetDefault(void){
  function SQLITE_PRIVATE (line 28128) | SQLITE_PRIVATE void sqlite3MemdebugSetType(void *p, u8 eType){
  function SQLITE_PRIVATE (line 28146) | SQLITE_PRIVATE int sqlite3MemdebugHasType(const void *p, u8 eType){
  function SQLITE_PRIVATE (line 28168) | SQLITE_PRIVATE int sqlite3MemdebugNoType(const void *p, u8 eType){
  function SQLITE_PRIVATE (line 28186) | SQLITE_PRIVATE void sqlite3MemdebugBacktrace(int depth){
  function SQLITE_PRIVATE (line 28193) | SQLITE_PRIVATE void sqlite3MemdebugBacktraceCallback(void (*xBacktrace)(...
  function SQLITE_PRIVATE (line 28200) | SQLITE_PRIVATE void sqlite3MemdebugSettitle(const char *zTitle){
  function SQLITE_PRIVATE (line 28210) | SQLITE_PRIVATE void sqlite3MemdebugSync(){
  function SQLITE_PRIVATE (line 28223) | SQLITE_PRIVATE void sqlite3MemdebugDump(const char *zFilename){
  function SQLITE_PRIVATE (line 28265) | SQLITE_PRIVATE int sqlite3MemdebugMallocCount(){
  type Mem3Block (line 28358) | typedef struct Mem3Block Mem3Block;
  type Mem3Block (line 28359) | struct Mem3Block {
  function SQLITE_WSD (line 28378) | static SQLITE_WSD struct Mem3Global {
  function memsys3UnlinkFromList (line 28425) | static void memsys3UnlinkFromList(u32 i, u32 *pRoot){
  function memsys3Unlink (line 28445) | static void memsys3Unlink(u32 i){
  function memsys3LinkIntoList (line 28465) | static void memsys3LinkIntoList(u32 i, u32 *pRoot){
  function memsys3Link (line 28479) | static void memsys3Link(u32 i){
  function memsys3Enter (line 28500) | static void memsys3Enter(void){
  function memsys3Leave (line 28506) | static void memsys3Leave(void){
  function memsys3OutOfMemory (line 28513) | static void memsys3OutOfMemory(int nByte){
  function memsys3Merge (line 28593) | static void memsys3Merge(u32 *pRoot){
  function memsys3FreeUnsafe (line 28714) | static void memsys3FreeUnsafe(void *pOld){
  function memsys3Size (line 28755) | static int memsys3Size(void *p){
  function memsys3Roundup (line 28766) | static int memsys3Roundup(int n){
  function memsys3Free (line 28789) | static void memsys3Free(void *pPrior){
  function memsys3Init (line 28830) | static int memsys3Init(void *NotUsed){
  function memsys3Shutdown (line 28855) | static void memsys3Shutdown(void *NotUsed){
  function SQLITE_PRIVATE (line 28867) | SQLITE_PRIVATE void sqlite3Memsys3Dump(const char *zFilename){
  function SQLITE_PRIVATE (line 28951) | SQLITE_PRIVATE const sqlite3_mem_methods *sqlite3MemGetMemsys3(void){
  type Mem5Link (line 29035) | typedef struct Mem5Link Mem5Link;
  type Mem5Link (line 29036) | struct Mem5Link {
  function SQLITE_WSD (line 29060) | static SQLITE_WSD struct Mem5Global {
  function memsys5Unlink (line 29117) | static void memsys5Unlink(int i, int iLogsize){
  function memsys5Link (line 29139) | static void memsys5Link(int i, int iLogsize){
  function memsys5Enter (line 29158) | static void memsys5Enter(void){
  function memsys5Leave (line 29161) | static void memsys5Leave(void){
  function memsys5Size (line 29169) | static int memsys5Size(void *p){
  function memsys5FreeUnsafe (line 29258) | static void memsys5FreeUnsafe(void *pOld){
  function memsys5Free (line 29340) | static void memsys5Free(void *pPrior){
  function memsys5Roundup (line 29389) | static int memsys5Roundup(int n){
  function memsys5Log (line 29415) | static int memsys5Log(int iValue){
  function memsys5Init (line 29427) | static int memsys5Init(void *NotUsed){
  function memsys5Shutdown (line 29485) | static void memsys5Shutdown(void *NotUsed){
  function SQLITE_PRIVATE (line 29496) | SQLITE_PRIVATE void sqlite3Memsys5Dump(const char *zFilename){
  function SQLITE_PRIVATE (line 29539) | SQLITE_PRIVATE const sqlite3_mem_methods *sqlite3MemGetMemsys5(void){
  type CheckMutex (line 29610) | typedef struct CheckMutex CheckMutex;
  type CheckMutex (line 29611) | struct CheckMutex {
  function checkMutexHeld (line 29625) | static int checkMutexHeld(sqlite3_mutex *p){
  function checkMutexNotheld (line 29628) | static int checkMutexNotheld(sqlite3_mutex *p){
  function checkMutexInit (line 29636) | static int checkMutexInit(void){
  function checkMutexEnd (line 29640) | static int checkMutexEnd(void){
  function sqlite3_mutex (line 29648) | static sqlite3_mutex *checkMutexAlloc(int iType){
  function checkMutexFree (line 29687) | static void checkMutexFree(sqlite3_mutex *p){
  function checkMutexEnter (line 29710) | static void checkMutexEnter(sqlite3_mutex *p){
  function checkMutexTry (line 29726) | static int checkMutexTry(sqlite3_mutex *p){
  function checkMutexLeave (line 29734) | static void checkMutexLeave(sqlite3_mutex *p){
  function sqlite3_mutex_methods (line 29739) | sqlite3_mutex_methods const *multiThreadedCheckMutex(void){
  function SQLITE_PRIVATE (line 29763) | SQLITE_PRIVATE void sqlite3MutexWarnOnContention(sqlite3_mutex *p){
  function SQLITE_PRIVATE (line 29775) | SQLITE_PRIVATE int sqlite3MutexInit(void){
  function SQLITE_PRIVATE (line 29821) | SQLITE_PRIVATE int sqlite3MutexEnd(void){
  function SQLITE_API (line 29837) | SQLITE_API sqlite3_mutex *sqlite3_mutex_alloc(int id){
  function SQLITE_PRIVATE (line 29846) | SQLITE_PRIVATE sqlite3_mutex *sqlite3MutexAlloc(int id){
  function SQLITE_API (line 29858) | SQLITE_API void sqlite3_mutex_free(sqlite3_mutex *p){
  function SQLITE_API (line 29869) | SQLITE_API void sqlite3_mutex_enter(sqlite3_mutex *p){
  function SQLITE_API (line 29880) | SQLITE_API int sqlite3_mutex_try(sqlite3_mutex *p){
  function SQLITE_API (line 29895) | SQLITE_API void sqlite3_mutex_leave(sqlite3_mutex *p){
  function SQLITE_API (line 29910) | SQLITE_API int sqlite3_mutex_held(sqlite3_mutex *p){
  function SQLITE_API (line 29919) | SQLITE_API int sqlite3_mutex_notheld(sqlite3_mutex *p){
  function noopMutexInit (line 29971) | static int noopMutexInit(void){ return SQLITE_OK; }
  function noopMutexEnd (line 29972) | static int noopMutexEnd(void){ return SQLITE_OK; }
  function sqlite3_mutex (line 29973) | static sqlite3_mutex *noopMutexAlloc(int id){
  function noopMutexFree (line 29977) | static void noopMutexFree(sqlite3_mutex *p){ UNUSED_PARAMETER(p); return; }
  function noopMutexEnter (line 29978) | static void noopMutexEnter(sqlite3_mutex *p){ UNUSED_PARAMETER(p); retur...
  function noopMutexTry (line 29979) | static int noopMutexTry(sqlite3_mutex *p){
  function noopMutexLeave (line 29983) | static void noopMutexLeave(sqlite3_mutex *p){ UNUSED_PARAMETER(p); retur...
  function SQLITE_PRIVATE (line 29985) | SQLITE_PRIVATE sqlite3_mutex_methods const *sqlite3NoopMutex(void){
  type sqlite3_debug_mutex (line 30013) | typedef struct sqlite3_debug_mutex {
  function debugMutexHeld (line 30022) | static int debugMutexHeld(sqlite3_mutex *pX){
  function debugMutexNotheld (line 30026) | static int debugMutexNotheld(sqlite3_mutex *pX){
  function debugMutexInit (line 30034) | static int debugMutexInit(void){ return SQLITE_OK; }
  function debugMutexEnd (line 30035) | static int debugMutexEnd(void){ return SQLITE_OK; }
  function sqlite3_mutex (line 30042) | static sqlite3_mutex *debugMutexAlloc(int id){
  function debugMutexFree (line 30073) | static void debugMutexFree(sqlite3_mutex *pX){
  function debugMutexEnter (line 30096) | static void debugMutexEnter(sqlite3_mutex *pX){
  function debugMutexTry (line 30101) | static int debugMutexTry(sqlite3_mutex *pX){
  function debugMutexLeave (line 30114) | static void debugMutexLeave(sqlite3_mutex *pX){
  function SQLITE_PRIVATE (line 30121) | SQLITE_PRIVATE sqlite3_mutex_methods const *sqlite3NoopMutex(void){
  function SQLITE_PRIVATE (line 30144) | SQLITE_PRIVATE sqlite3_mutex_methods const *sqlite3DefaultMutex(void){
  type sqlite3_mutex (line 30192) | struct sqlite3_mutex {
  function pthreadMutexHeld (line 30229) | static int pthreadMutexHeld(sqlite3_mutex *p){
  function pthreadMutexNotheld (line 30232) | static int pthreadMutexNotheld(sqlite3_mutex *p){
  function SQLITE_PRIVATE (line 30242) | SQLITE_PRIVATE void sqlite3MemoryBarrier(void){
  function pthreadMutexInit (line 30253) | static int pthreadMutexInit(void){ return SQLITE_OK; }
  function pthreadMutexEnd (line 30254) | static int pthreadMutexEnd(void){ return SQLITE_OK; }
  function sqlite3_mutex (line 30304) | static sqlite3_mutex *pthreadMutexAlloc(int iType){
  function pthreadMutexFree (line 30375) | static void pthreadMutexFree(sqlite3_mutex *p){
  function pthreadMutexEnter (line 30402) | static void pthreadMutexEnter(sqlite3_mutex *p){
  function pthreadMutexTry (line 30444) | static int pthreadMutexTry(sqlite3_mutex *p){
  function pthreadMutexLeave (line 30501) | static void pthreadMutexLeave(sqlite3_mutex *p){
  function SQLITE_PRIVATE (line 30524) | SQLITE_PRIVATE sqlite3_mutex_methods const *sqlite3DefaultMutex(void){
  type sqlite3_mutex (line 30679) | struct sqlite3_mutex {
  function winMutexHeld (line 30708) | static int winMutexHeld(sqlite3_mutex *p){
  function winMutexNotheld2 (line 30712) | static int winMutexNotheld2(sqlite3_mutex *p, DWORD tid){
  function winMutexNotheld (line 30716) | static int winMutexNotheld(sqlite3_mutex *p){
  function SQLITE_PRIVATE (line 30727) | SQLITE_PRIVATE void sqlite3MemoryBarrier(void){
  function winMutexInit (line 30769) | static int winMutexInit(void){
  function winMutexEnd (line 30791) | static int winMutexEnd(void){
  function sqlite3_mutex (line 30854) | static sqlite3_mutex *winMutexAlloc(int iType){
  function winMutexFree (line 30902) | static void winMutexFree(sqlite3_mutex *p){
  function winMutexEnter (line 30926) | static void winMutexEnter(sqlite3_mutex *p){
  function winMutexTry (line 30949) | static int winMutexTry(sqlite3_mutex *p){
  function winMutexLeave (line 30999) | static void winMutexLeave(sqlite3_mutex *p){
  function SQLITE_PRIVATE (line 31021) | SQLITE_PRIVATE sqlite3_mutex_methods const *sqlite3DefaultMutex(void){
  function SQLITE_API (line 31067) | SQLITE_API int sqlite3_release_memory(int n){
  function SQLITE_WSD (line 31089) | static SQLITE_WSD struct Mem0Global {
  function SQLITE_PRIVATE (line 31106) | SQLITE_PRIVATE sqlite3_mutex *sqlite3MallocMutex(void){
  function SQLITE_API (line 31116) | SQLITE_API int sqlite3_memory_alarm(
  function SQLITE_API (line 31139) | SQLITE_API sqlite3_int64 sqlite3_soft_heap_limit64(sqlite3_int64 n){
  function SQLITE_API (line 31164) | SQLITE_API void sqlite3_soft_heap_limit(int n){
  function SQLITE_API (line 31181) | SQLITE_API sqlite3_int64 sqlite3_hard_heap_limit64(sqlite3_int64 n){
  function SQLITE_PRIVATE (line 31203) | SQLITE_PRIVATE int sqlite3MallocInit(void){
  function SQLITE_PRIVATE (line 31224) | SQLITE_PRIVATE int sqlite3HeapNearlyFull(void){
  function SQLITE_PRIVATE (line 31231) | SQLITE_PRIVATE void sqlite3MallocEnd(void){
  function sqlite3_memory_used (line 31241) | sqlite3_memory_used(void){
  function SQLITE_API (line 31252) | SQLITE_API sqlite3_int64 sqlite3_memory_highwater(int resetFlag){
  function sqlite3MallocAlarm (line 31261) | static void sqlite3MallocAlarm(int nByte){
  function SQLITE_NOINLINE (line 31275) | static SQLITE_NOINLINE void test_oom_breakpoint(u64 n){
  function mallocWithAlarm (line 31290) | static void mallocWithAlarm(int n, void **pp){
  function SQLITE_PRIVATE (line 31340) | SQLITE_PRIVATE void *sqlite3Malloc(u64 n){
  function SQLITE_API (line 31360) | SQLITE_API void *sqlite3_malloc(int n){
  function SQLITE_API (line 31366) | SQLITE_API void *sqlite3_malloc64(sqlite3_uint64 n){
  function isLookaside (line 31377) | static int isLookaside(sqlite3 *db, const void *p){
  function SQLITE_PRIVATE (line 31388) | SQLITE_PRIVATE int sqlite3MallocSize(const void *p){
  function lookasideMallocSize (line 31392) | static int lookasideMallocSize(sqlite3 *db, const void *p){
  function SQLITE_PRIVATE (line 31399) | SQLITE_PRIVATE int sqlite3DbMallocSize(sqlite3 *db, const void *p){
  function SQLITE_API (line 31426) | SQLITE_API sqlite3_uint64 sqlite3_msize(void *p){
  function SQLITE_API (line 31435) | SQLITE_API void sqlite3_free(void *p){
  function SQLITE_NOINLINE (line 31454) | static SQLITE_NOINLINE void measureAllocationSize(sqlite3 *db, void *p){
  function SQLITE_PRIVATE (line 31463) | SQLITE_PRIVATE void sqlite3DbFreeNN(sqlite3 *db, void *p){
  function SQLITE_PRIVATE (line 31502) | SQLITE_PRIVATE void sqlite3DbNNFreeNN(sqlite3 *db, void *p){
  function SQLITE_PRIVATE (line 31539) | SQLITE_PRIVATE void sqlite3DbFree(sqlite3 *db, void *p){
  function SQLITE_PRIVATE (line 31547) | SQLITE_PRIVATE void *sqlite3Realloc(void *pOld, u64 nBytes){
  function SQLITE_API (line 31606) | SQLITE_API void *sqlite3_realloc(void *pOld, int n){
  function SQLITE_API (line 31613) | SQLITE_API void *sqlite3_realloc64(void *pOld, sqlite3_uint64 n){
  function SQLITE_PRIVATE (line 31624) | SQLITE_PRIVATE void *sqlite3MallocZero(u64 n){
  function SQLITE_PRIVATE (line 31636) | SQLITE_PRIVATE void *sqlite3DbMallocZero(sqlite3 *db, u64 n){
  function SQLITE_NOINLINE (line 31648) | static SQLITE_NOINLINE void *dbMallocRawFinish(sqlite3 *db, u64 n){
  function SQLITE_PRIVATE (line 31680) | SQLITE_PRIVATE void *sqlite3DbMallocRaw(sqlite3 *db, u64 n){
  function SQLITE_PRIVATE (line 31687) | SQLITE_PRIVATE void *sqlite3DbMallocRawNN(sqlite3 *db, u64 n){
  function SQLITE_PRIVATE (line 31743) | SQLITE_PRIVATE void *sqlite3DbRealloc(sqlite3 *db, void *p, u64 n){
  function SQLITE_NOINLINE (line 31759) | static SQLITE_NOINLINE void *dbReallocFinish(sqlite3 *db, void *p, u64 n){
  function SQLITE_PRIVATE (line 31789) | SQLITE_PRIVATE void *sqlite3DbReallocOrFree(sqlite3 *db, void *p, u64 n){
  function SQLITE_PRIVATE (line 31805) | SQLITE_PRIVATE char *sqlite3DbStrDup(sqlite3 *db, const char *z){
  function SQLITE_PRIVATE (line 31818) | SQLITE_PRIVATE char *sqlite3DbStrNDup(sqlite3 *db, const char *z, u64 n){
  function SQLITE_PRIVATE (line 31836) | SQLITE_PRIVATE char *sqlite3DbSpanDup(sqlite3 *db, const char *zStart, c...
  function SQLITE_PRIVATE (line 31852) | SQLITE_PRIVATE void sqlite3SetString(char **pz, sqlite3 *db, const char ...
  function SQLITE_PRIVATE (line 31871) | SQLITE_PRIVATE void *sqlite3OomFault(sqlite3 *db){
  function SQLITE_PRIVATE (line 31898) | SQLITE_PRIVATE void sqlite3OomClear(sqlite3 *db){
  function SQLITE_NOINLINE (line 31910) | static SQLITE_NOINLINE int apiHandleError(sqlite3 *db, int rc){
  function SQLITE_PRIVATE (line 31931) | SQLITE_PRIVATE int sqlite3ApiExit(sqlite3* db, int rc){
  type etByte (line 31989) | typedef unsigned char etByte;
  type et_info (line 31995) | typedef struct et_info {   /* Information about each format field */
  function foreach (line 32019) | foreach c {d s g z q Q w c o u x X f e E G i n % p T S r} {
  function incr (line 32028) | incr r} {
  function SQLITE_PRIVATE (line 32074) | SQLITE_PRIVATE void sqlite3StrAccumSetError(StrAccum *p, u8 eError){
  function sqlite3_int64 (line 32084) | static sqlite3_int64 getIntArg(PrintfArguments *p){
  function getDoubleArg (line 32088) | static double getDoubleArg(PrintfArguments *p){
  function SQLITE_API (line 32139) | SQLITE_API void sqlite3_str_vappendf(
  function SQLITE_PRIVATE (line 32960) | SQLITE_PRIVATE void sqlite3RecordErrorByteOffset(sqlite3 *db, const char...
  function SQLITE_PRIVATE (line 32981) | SQLITE_PRIVATE void sqlite3RecordErrorOffsetOfExpr(sqlite3 *db, const Ex...
  function SQLITE_PRIVATE (line 32999) | SQLITE_PRIVATE int sqlite3StrAccumEnlarge(StrAccum *p, i64 N){
  function SQLITE_API (line 33049) | SQLITE_API void sqlite3_str_appendchar(sqlite3_str *p, int N, char c){
  function enlargeAndAppend (line 33065) | static void SQLITE_NOINLINE enlargeAndAppend(StrAccum *p, const char *z,...
  function SQLITE_API (line 33077) | SQLITE_API void sqlite3_str_append(sqlite3_str *p, const char *z, int N){
  function SQLITE_API (line 33094) | SQLITE_API void sqlite3_str_appendall(sqlite3_str *p, const char *z){
  function SQLITE_NOINLINE (line 33104) | static SQLITE_NOINLINE char *strAccumFinishRealloc(StrAccum *p){
  function SQLITE_PRIVATE (line 33117) | SQLITE_PRIVATE char *sqlite3StrAccumFinish(StrAccum *p){
  function SQLITE_PRIVATE (line 33131) | SQLITE_PRIVATE void sqlite3ResultStrAccum(sqlite3_context *pCtx, StrAccu...
  function SQLITE_API (line 33155) | SQLITE_API char *sqlite3_str_finish(sqlite3_str *p){
  function SQLITE_API (line 33167) | SQLITE_API int sqlite3_str_errcode(sqlite3_str *p){
  function SQLITE_API (line 33172) | SQLITE_API int sqlite3_str_length(sqlite3_str *p){
  function SQLITE_API (line 33177) | SQLITE_API char *sqlite3_str_value(sqlite3_str *p){
  function SQLITE_API (line 33186) | SQLITE_API void sqlite3_str_reset(StrAccum *p){
  function SQLITE_PRIVATE (line 33210) | SQLITE_PRIVATE void sqlite3StrAccumInit(StrAccum *p, sqlite3 *db, char *...
  function SQLITE_API (line 33221) | SQLITE_API sqlite3_str *sqlite3_str_new(sqlite3 *db){
  function SQLITE_PRIVATE (line 33236) | SQLITE_PRIVATE char *sqlite3VMPrintf(sqlite3 *db, const char *zFormat, v...
  function SQLITE_PRIVATE (line 33256) | SQLITE_PRIVATE char *sqlite3MPrintf(sqlite3 *db, const char *zFormat, ...){
  function SQLITE_API (line 33269) | SQLITE_API char *sqlite3_vmprintf(const char *zFormat, va_list ap){
  function SQLITE_API (line 33293) | SQLITE_API char *sqlite3_mprintf(const char *zFormat, ...){
  function SQLITE_API (line 33318) | SQLITE_API char *sqlite3_vsnprintf(int n, char *zBuf, const char *zForma...
  function SQLITE_API (line 33333) | SQLITE_API char *sqlite3_snprintf(int n, char *zBuf, const char *zFormat...
  function renderLogMsg (line 33375) | static void renderLogMsg(int iErrCode, const char *zFormat, va_list ap){
  function SQLITE_API (line 33388) | SQLITE_API void sqlite3_log(int iErrCode, const char *zFormat, ...){
  function SQLITE_PRIVATE (line 33403) | SQLITE_PRIVATE void sqlite3DebugPrintf(const char *zFormat, ...){
  function SQLITE_API (line 33429) | SQLITE_API void sqlite3_str_appendf(StrAccum *p, const char *zFormat, ...){
  function SQLITE_PRIVATE (line 33446) | SQLITE_PRIVATE char *sqlite3RCStrRef(char *z){
  function SQLITE_PRIVATE (line 33458) | SQLITE_PRIVATE void sqlite3RCStrUnref(void *z){
  function SQLITE_PRIVATE (line 33479) | SQLITE_PRIVATE char *sqlite3RCStrNew(u64 N){
  function SQLITE_PRIVATE (line 33490) | SQLITE_PRIVATE char *sqlite3RCStrResize(char *z, u64 N){
  function sqlite3TreeViewPush (line 33533) | static void sqlite3TreeViewPush(TreeView **pp, u8 moreToFollow){
  function sqlite3TreeViewPop (line 33549) | static void sqlite3TreeViewPop(TreeView **pp){
  function SQLITE_PRIVATE (line 33563) | SQLITE_PRIVATE void sqlite3TreeViewLine(TreeView *p, const char *zFormat...
  function sqlite3TreeViewItem (line 33590) | static void sqlite3TreeViewItem(TreeView *p, const char *zLabel,u8 moreF...
  function SQLITE_PRIVATE (line 33598) | SQLITE_PRIVATE void sqlite3TreeViewColumnList(
  function SQLITE_PRIVATE (line 33645) | SQLITE_PRIVATE void sqlite3TreeViewWith(TreeView *pView, const With *pWi...
  function SQLITE_PRIVATE (line 33691) | SQLITE_PRIVATE void sqlite3TreeViewSrcList(TreeView *pView, const SrcLis...
  function SQLITE_PRIVATE (line 33774) | SQLITE_PRIVATE void sqlite3TreeViewSelect(TreeView *pView, const Select ...
  function SQLITE_PRIVATE (line 33890) | SQLITE_PRIVATE void sqlite3TreeViewBound(
  function SQLITE_PRIVATE (line 33927) | SQLITE_PRIVATE void sqlite3TreeViewWindow(TreeView *pView, const Window ...
  function SQLITE_PRIVATE (line 33994) | SQLITE_PRIVATE void sqlite3TreeViewWinFunc(TreeView *pView, const Window...
  function SQLITE_PRIVATE (line 34007) | SQLITE_PRIVATE void sqlite3TreeViewExpr(TreeView *pView, const Expr *pEx...
  function SQLITE_PRIVATE (line 34406) | SQLITE_PRIVATE void sqlite3TreeViewBareExprList(
  function SQLITE_PRIVATE (line 34460) | SQLITE_PRIVATE void sqlite3TreeViewExprList(
  function SQLITE_PRIVATE (line 34474) | SQLITE_PRIVATE void sqlite3TreeViewBareIdList(
  function SQLITE_PRIVATE (line 34496) | SQLITE_PRIVATE void sqlite3TreeViewIdList(
  function SQLITE_PRIVATE (line 34510) | SQLITE_PRIVATE void sqlite3TreeViewUpsert(
  function SQLITE_PRIVATE (line 34541) | SQLITE_PRIVATE void sqlite3TreeViewDelete(
  function SQLITE_PRIVATE (line 34597) | SQLITE_PRIVATE void sqlite3TreeViewInsert(
  function SQLITE_PRIVATE (line 34667) | SQLITE_PRIVATE void sqlite3TreeViewUpdate(
  function SQLITE_PRIVATE (line 34744) | SQLITE_PRIVATE void sqlite3TreeViewTriggerStep(
  function SQLITE_PRIVATE (line 34767) | SQLITE_PRIVATE void sqlite3TreeViewTrigger(
  function SQLITE_PRIVATE (line 34806) | SQLITE_PRIVATE void sqlite3ShowExpr(const Expr *p){ sqlite3TreeViewExpr(...
  function SQLITE_PRIVATE (line 34807) | SQLITE_PRIVATE void sqlite3ShowExprList(const ExprList *p){ sqlite3TreeV...
  function SQLITE_PRIVATE (line 34808) | SQLITE_PRIVATE void sqlite3ShowIdList(const IdList *p){ sqlite3TreeViewI...
  function SQLITE_PRIVATE (line 34809) | SQLITE_PRIVATE void sqlite3ShowSrcList(const SrcList *p){ sqlite3TreeVie...
  function SQLITE_PRIVATE (line 34810) | SQLITE_PRIVATE void sqlite3ShowSelect(const Select *p){ sqlite3TreeViewS...
  function SQLITE_PRIVATE (line 34811) | SQLITE_PRIVATE void sqlite3ShowWith(const With *p){ sqlite3TreeViewWith(...
  function SQLITE_PRIVATE (line 34812) | SQLITE_PRIVATE void sqlite3ShowUpsert(const Upsert *p){ sqlite3TreeViewU...
  function SQLITE_PRIVATE (line 34814) | SQLITE_PRIVATE void sqlite3ShowTriggerStep(const TriggerStep *p){
  function SQLITE_PRIVATE (line 34817) | SQLITE_PRIVATE void sqlite3ShowTriggerStepList(const TriggerStep *p){
  function SQLITE_PRIVATE (line 34820) | SQLITE_PRIVATE void sqlite3ShowTrigger(const Trigger *p){ sqlite3TreeVie...
  function SQLITE_PRIVATE (line 34821) | SQLITE_PRIVATE void sqlite3ShowTriggerList(const Trigger *p){ sqlite3Tre...
  function SQLITE_PRIVATE (line 34824) | SQLITE_PRIVATE void sqlite3ShowWindow(const Window *p){ sqlite3TreeViewW...
  function SQLITE_PRIVATE (line 34825) | SQLITE_PRIVATE void sqlite3ShowWinFunc(const Window *p){ sqlite3TreeView...
  function SQLITE_WSD (line 34855) | static SQLITE_WSD struct sqlite3PrngType {
  function chacha_block (line 34870) | static void chacha_block(u32 *out, const u32 *in){
  function SQLITE_API (line 34890) | SQLITE_API void sqlite3_randomness(int N, void *pBuf){
  function SQLITE_PRIVATE (line 34974) | SQLITE_PRIVATE void sqlite3PrngSaveState(void){
  function SQLITE_PRIVATE (line 34981) | SQLITE_PRIVATE void sqlite3PrngRestoreState(void){
  type SQLiteThread (line 35033) | struct SQLiteThread {
  function SQLITE_PRIVATE (line 35042) | SQLITE_PRIVATE int sqlite3ThreadCreate(
  function SQLITE_PRIVATE (line 35079) | SQLITE_PRIVATE int sqlite3ThreadJoin(SQLiteThread *p, void **ppOut){
  type SQLiteThread (line 35105) | struct SQLiteThread {
  function sqlite3ThreadProc (line 35114) | static unsigned __stdcall sqlite3ThreadProc(
  function SQLITE_PRIVATE (line 35137) | SQLITE_PRIVATE int sqlite3ThreadCreate(
  function SQLITE_PRIVATE (line 35175) | SQLITE_PRIVATE int sqlite3ThreadJoin(SQLiteThread *p, void **ppOut){
  type SQLiteThread (line 35210) | struct SQLiteThread {
  function SQLITE_PRIVATE (line 35217) | SQLITE_PRIVATE int sqlite3ThreadCreate(
  function SQLITE_PRIVATE (line 35241) | SQLITE_PRIVATE int sqlite3ThreadJoin(SQLiteThread *p, void **ppOut){
  function SQLITE_PRIVATE (line 35382) | SQLITE_PRIVATE int sqlite3AppendOneUtf8Character(char *zOut, u32 v){
  function SQLITE_PRIVATE (line 35443) | SQLITE_PRIVATE u32 sqlite3Utf8Read(
  function SQLITE_PRIVATE (line 35476) | SQLITE_PRIVATE int sqlite3Utf8ReadLimited(
  function sqlite3VdbeMemTranslate (line 35510) | int sqlite3VdbeMemTranslate(Mem *pMem, u8 desiredEnc){
  function SQLITE_PRIVATE (line 35705) | SQLITE_PRIVATE int sqlite3VdbeMemHandleBom(Mem *pMem){
  function SQLITE_PRIVATE (line 35743) | SQLITE_PRIVATE int sqlite3Utf8CharLen(const char *zIn, int nByte){
  function SQLITE_PRIVATE (line 35773) | SQLITE_PRIVATE int sqlite3Utf8To8(unsigned char *zIn){
  function SQLITE_PRIVATE (line 35797) | SQLITE_PRIVATE char *sqlite3Utf16to8(sqlite3 *db, const void *z, int nBy...
  function SQLITE_PRIVATE (line 35819) | SQLITE_PRIVATE int sqlite3Utf16ByteLen(const void *zIn, int nByte, int n...
  function SQLITE_PRIVATE (line 35842) | SQLITE_PRIVATE void sqlite3UtfSelfTest(void){
  function SQLITE_PRIVATE (line 35912) | SQLITE_PRIVATE int sqlite3FaultSim(int iTest){
  function SQLITE_PRIVATE (line 35925) | SQLITE_PRIVATE int sqlite3IsNaN(double x){
  function SQLITE_PRIVATE (line 35943) | SQLITE_PRIVATE int sqlite3IsOverflow(double x){
  function SQLITE_PRIVATE (line 35960) | SQLITE_PRIVATE int sqlite3Strlen30(const char *z){
  function SQLITE_PRIVATE (line 35972) | SQLITE_PRIVATE char *sqlite3ColumnType(Column *pCol, char *zDflt){
  function SQLITE_NOINLINE (line 35988) | static SQLITE_NOINLINE void  sqlite3ErrorFinish(sqlite3 *db, int err_code){
  function SQLITE_PRIVATE (line 35998) | SQLITE_PRIVATE void sqlite3Error(sqlite3 *db, int err_code){
  function SQLITE_PRIVATE (line 36012) | SQLITE_PRIVATE void sqlite3ErrorClear(sqlite3 *db){
  function SQLITE_PRIVATE (line 36023) | SQLITE_PRIVATE void sqlite3SystemError(sqlite3 *db, int rc){
  function SQLITE_PRIVATE (line 36060) | SQLITE_PRIVATE void sqlite3ErrorWithMsg(sqlite3 *db, int err_code, const...
  function SQLITE_PRIVATE (line 36079) | SQLITE_PRIVATE void sqlite3ProgressCheck(Parse *p){
  function SQLITE_PRIVATE (line 36110) | SQLITE_PRIVATE void sqlite3ErrorMsg(Parse *pParse, const char *zFormat, ...
  function SQLITE_PRIVATE (line 36141) | SQLITE_PRIVATE int sqlite3ErrorToParser(sqlite3 *db, int errCode){
  function SQLITE_PRIVATE (line 36166) | SQLITE_PRIVATE void sqlite3Dequote(char *z){
  function SQLITE_PRIVATE (line 36188) | SQLITE_PRIVATE void sqlite3DequoteExpr(Expr *p){
  function SQLITE_PRIVATE (line 36200) | SQLITE_PRIVATE void sqlite3DequoteNumber(Parse *pParse, Expr *p){
  function SQLITE_PRIVATE (line 36244) | SQLITE_PRIVATE void sqlite3DequoteToken(Token *p){
  function SQLITE_PRIVATE (line 36258) | SQLITE_PRIVATE void sqlite3TokenInit(Token *p, char *z){
  function SQLITE_API (line 36276) | SQLITE_API int sqlite3_stricmp(const char *zLeft, const char *zRight){
  function SQLITE_PRIVATE (line 36284) | SQLITE_PRIVATE int sqlite3StrICmp(const char *zLeft, const char *zRight){
  function SQLITE_API (line 36303) | SQLITE_API int sqlite3_strnicmp(const char *zLeft, const char *zRight, i...
  function SQLITE_PRIVATE (line 36319) | SQLITE_PRIVATE u8 sqlite3StrIHash(const char *z){
  function dekkerMul2 (line 36335) | static void dekkerMul2(volatile double *x, double y, double yy){
  function SQLITE_PRIVATE (line 36397) | SQLITE_PRIVATE int sqlite3AtoF(const char *z, double *pResult, int lengt...
  function SQLITE_PRIVATE (line 36597) | SQLITE_PRIVATE int sqlite3Int64ToText(i64 v, char *zOut){
  function compare2pow63 (line 36633) | static int compare2pow63(const char *zNum, int incr){
  function SQLITE_PRIVATE (line 36666) | SQLITE_PRIVATE int sqlite3Atoi64(const char *zNum, i64 *pNum, int length...
  function SQLITE_PRIVATE (line 36769) | SQLITE_PRIVATE int sqlite3DecOrHexToI64(const char *z, i64 *pOut){
  function SQLITE_PRIVATE (line 36803) | SQLITE_PRIVATE int sqlite3GetInt32(const char *zNum, int *pValue){
  function SQLITE_PRIVATE (line 36862) | SQLITE_PRIVATE int sqlite3Atoi(const char *z){
  function SQLITE_PRIVATE (line 36885) | SQLITE_PRIVATE void sqlite3FpDecode(FpDecode *p, double r, int iRound, i...
  function SQLITE_PRIVATE (line 37014) | SQLITE_PRIVATE int sqlite3GetUInt32(const char *z, u32 *pI){
  function putVarint64 (line 37055) | static int SQLITE_NOINLINE putVarint64(unsigned char *p, u64 v){
  function SQLITE_PRIVATE (line 37079) | SQLITE_PRIVATE int sqlite3PutVarint(unsigned char *p, u64 v){
  function SQLITE_PRIVATE (line 37109) | SQLITE_PRIVATE u8 sqlite3GetVarint(const unsigned char *p, u64 *v){
  function SQLITE_PRIVATE (line 37270) | SQLITE_PRIVATE u8 sqlite3GetVarint32(const unsigned char *p, u32 *v){
  function SQLITE_PRIVATE (line 37303) | SQLITE_PRIVATE int sqlite3VarintLen(u64 v){
  function SQLITE_PRIVATE (line 37313) | SQLITE_PRIVATE u32 sqlite3Get4byte(const u8 *p){
  function SQLITE_PRIVATE (line 37331) | SQLITE_PRIVATE void sqlite3Put4byte(unsigned char *p, u32 v){
  function SQLITE_PRIVATE (line 37355) | SQLITE_PRIVATE u8 sqlite3HexToInt(int h){
  function SQLITE_PRIVATE (line 37373) | SQLITE_PRIVATE void *sqlite3HexToBlob(sqlite3 *db, const char *z, int n){
  function logBadConnection (line 37394) | static void logBadConnection(const char *zType){
  function SQLITE_PRIVATE (line 37415) | SQLITE_PRIVATE int sqlite3SafetyCheckOk(sqlite3 *db){
  function SQLITE_PRIVATE (line 37432) | SQLITE_PRIVATE int sqlite3SafetyCheckSickOrOk(sqlite3 *db){
  function SQLITE_PRIVATE (line 37452) | SQLITE_PRIVATE int sqlite3AddInt64(i64 *pA, i64 iB){
  function SQLITE_PRIVATE (line 37472) | SQLITE_PRIVATE int sqlite3SubInt64(i64 *pA, i64 iB){
  function SQLITE_PRIVATE (line 37487) | SQLITE_PRIVATE int sqlite3MulInt64(i64 *pA, i64 iB){
  function SQLITE_PRIVATE (line 37513) | SQLITE_PRIVATE int sqlite3AbsInt32(int x){
  function SQLITE_PRIVATE (line 37537) | SQLITE_PRIVATE void sqlite3FileSuffix3(const char *zBaseFilename, char *z){
  function SQLITE_PRIVATE (line 37556) | SQLITE_PRIVATE LogEst sqlite3LogEstAdd(LogEst a, LogEst b){
  function SQLITE_PRIVATE (line 37583) | SQLITE_PRIVATE LogEst sqlite3LogEst(u64 x){
  function SQLITE_PRIVATE (line 37606) | SQLITE_PRIVATE LogEst sqlite3LogEstFromDouble(double x){
  function SQLITE_PRIVATE (line 37620) | SQLITE_PRIVATE u64 sqlite3LogEstToInt(LogEst x){
  function SQLITE_PRIVATE (line 37666) | SQLITE_PRIVATE VList *sqlite3VListAdd(
  function SQLITE_PRIVATE (line 37704) | SQLITE_PRIVATE const char *sqlite3VListNumToName(VList *pIn, int iVal){
  function SQLITE_PRIVATE (line 37720) | SQLITE_PRIVATE int sqlite3VListNameToNum(VList *pIn, const char *zName, ...
  function SQLITE_PRIVATE (line 37757) | SQLITE_PRIVATE void sqlite3HashInit(Hash *pNew){
  function SQLITE_PRIVATE (line 37769) | SQLITE_PRIVATE void sqlite3HashClear(Hash *pH){
  function strHash (line 37789) | static unsigned int strHash(const char *z){
  function insertElement (line 37813) | static void insertElement(
  function rehash (line 37847) | static int rehash(Hash *pH, unsigned int new_size){
  function HashElem (line 37887) | static HashElem *findElementWithHash(
  function removeElement (line 37922) | static void removeElement(
  function SQLITE_PRIVATE (line 37956) | SQLITE_PRIVATE void *sqlite3HashFind(const Hash *pH, const char *pKey){
  function SQLITE_PRIVATE (line 37976) | SQLITE_PRIVATE void *sqlite3HashInsert(Hash *pH, const char *pKey, void ...
  function SQLITE_PRIVATE (line 38021) | SQLITE_PRIVATE const char *sqlite3OpcodeName(int i){
  type KVVfsFile (line 38262) | typedef struct KVVfsFile KVVfsFile;
  type KVVfsFile (line 38267) | struct KVVfsFile {
  function kvstorageMakeKey (line 38400) | static void kvstorageMakeKey(
  function kvstorageWrite (line 38415) | static int kvstorageWrite(
  function kvstorageDelete (line 38440) | static int kvstorageDelete(const char *zClass, const char *zKey){
  function kvstorageRead (line 38463) | static int kvstorageRead(
  type sqlite3_kvvfs_methods (line 38514) | typedef struct sqlite3_kvvfs_methods sqlite3_kvvfs_methods;
  type sqlite3_kvvfs_methods (line 38515) | struct sqlite3_kvvfs_methods {
  function kvvfsEncode (line 38566) | static int kvvfsEncode(const char *aData, int nData, char *aOut){
  function kvvfsDecode (line 38619) | static int kvvfsDecode(const char *a, char *aOut, int nOut){
  function kvvfsDecodeJournal (line 38663) | static void kvvfsDecodeJournal(
  function sqlite3_int64 (line 38694) | static sqlite3_int64 kvvfsReadFileSize(KVVfsFile *pFile){
  function kvvfsWriteFileSize (line 38700) | static int kvvfsWriteFileSize(KVVfsFile *pFile, sqlite3_int64 sz){
  function kvvfsClose (line 38711) | static int kvvfsClose(sqlite3_file *pProtoFile){
  function kvvfsReadJrnl (line 38724) | static int kvvfsReadJrnl(
  function kvvfsReadDb (line 38756) | static int kvvfsReadDb(
  function kvvfsWriteJrnl (line 38814) | static int kvvfsWriteJrnl(
  function kvvfsWriteDb (line 38842) | static int kvvfsWriteDb(
  function kvvfsTruncateJrnl (line 38872) | static int kvvfsTruncateJrnl(sqlite3_file *pProtoFile, sqlite_int64 size){
  function kvvfsTruncateDb (line 38882) | static int kvvfsTruncateDb(sqlite3_file *pProtoFile, sqlite_int64 size){
  function kvvfsSyncJrnl (line 38907) | static int kvvfsSyncJrnl(sqlite3_file *pProtoFile, int flags){
  function kvvfsSyncDb (line 38931) | static int kvvfsSyncDb(sqlite3_file *pProtoFile, int flags){
  function kvvfsFileSizeJrnl (line 38938) | static int kvvfsFileSizeJrnl(sqlite3_file *pProtoFile, sqlite_int64 *pSi...
  function kvvfsFileSizeDb (line 38944) | static int kvvfsFileSizeDb(sqlite3_file *pProtoFile, sqlite_int64 *pSize){
  function kvvfsLock (line 38958) | static int kvvfsLock(sqlite3_file *pProtoFile, int eLock){
  function kvvfsUnlock (line 38972) | static int kvvfsUnlock(sqlite3_file *pProtoFile, int eLock){
  function kvvfsCheckReservedLock (line 38985) | static int kvvfsCheckReservedLock(sqlite3_file *pProtoFile, int *pResOut){
  function kvvfsFileControlJrnl (line 38994) | static int kvvfsFileControlJrnl(sqlite3_file *pProtoFile, int op, void *...
  function kvvfsFileControlDb (line 38998) | static int kvvfsFileControlDb(sqlite3_file *pProtoFile, int op, void *pA...
  function kvvfsSectorSize (line 39015) | static int kvvfsSectorSize(sqlite3_file *pFile){
  function kvvfsDeviceCharacteristics (line 39022) | static int kvvfsDeviceCharacteristics(sqlite3_file *pProtoFile){
  function kvvfsOpen (line 39031) | static int kvvfsOpen(
  function kvvfsDelete (line 39076) | static int kvvfsDelete(sqlite3_vfs *pVfs, const char *zPath, int dirSync){
  function kvvfsAccess (line 39090) | static int kvvfsAccess(
  function kvvfsFullPathname (line 39121) | static int kvvfsFullPathname(
  function kvvfsRandomness (line 39150) | static int kvvfsRandomness(sqlite3_vfs *pVfs, int nByte, char *zBufOut){
  function kvvfsSleep (line 39159) | static int kvvfsSleep(sqlite3_vfs *pVfs, int nMicro){
  function kvvfsCurrentTime (line 39166) | static int kvvfsCurrentTime(sqlite3_vfs *pVfs, double *pTimeOut){
  function kvvfsCurrentTimeInt64 (line 39174) | static int kvvfsCurrentTimeInt64(sqlite3_vfs *pVfs, sqlite3_int64 *pTime...
  function SQLITE_API (line 39187) | SQLITE_API int sqlite3_os_init(void){
  function SQLITE_API (line 39190) | SQLITE_API int sqlite3_os_end(void){
  function SQLITE_PRIVATE (line 39196) | SQLITE_PRIVATE int sqlite3KvvfsInit(void){
  type unixShm (line 39437) | typedef struct unixShm unixShm;
  type unixShmNode (line 39438) | typedef struct unixShmNode unixShmNode;
  type unixInodeInfo (line 39439) | typedef struct unixInodeInfo unixInodeInfo;
  type UnixUnusedFd (line 39440) | typedef struct UnixUnusedFd UnixUnusedFd;
  type UnixUnusedFd (line 39448) | struct UnixUnusedFd {
  type unixFile (line 39458) | typedef struct unixFile unixFile;
  type unixFile (line 39459) | struct unixFile {
  function posixOpen (line 39611) | static int posixOpen(const char *zFile, int flags, int mode){
  type unix_syscall (line 39625) | struct unix_syscall {
  type stat (line 39643) | struct stat
  type stat (line 39656) | struct stat
  type stat (line 39784) | struct stat
  function unixPosixAdvisoryLocks (line 39840) | static int unixPosixAdvisoryLocks(
  function robustFchown (line 39919) | static int robustFchown(int fd, uid_t uid, gid_t gid){
  function unixSetSystemCall (line 39933) | static int unixSetSystemCall(
  function sqlite3_syscall_ptr (line 39976) | static sqlite3_syscall_ptr unixGetSystemCall(
  function robust_open (line 40036) | static int robust_open(const char *z, int f, mode_t m){
  function unixEnterMutex (line 40101) | static void unixEnterMutex(void){
  function unixLeaveMutex (line 40105) | static void unixLeaveMutex(void){
  function unixMutexHeld (line 40110) | static int unixMutexHeld(void) {
  function lockTrace (line 40143) | static int lockTrace(int fd, int op, struct flock *p){
  function robust_ftruncate (line 40201) | static int robust_ftruncate(int h, sqlite3_int64 sz){
  function sqliteErrorFromPosixError (line 40226) | static int sqliteErrorFromPosixError(int posixError, int sqliteIOErr) {
  type vxworksFileId (line 40268) | struct vxworksFileId {
  type vxworksFileId (line 40280) | struct vxworksFileId
  function vxworksSimplifyName (line 40296) | static int vxworksSimplifyName(char *z, int n){
  type vxworksFileId (line 40330) | struct vxworksFileId
  type vxworksFileId (line 40331) | struct vxworksFileId
  type vxworksFileId (line 40332) | struct vxworksFileId
  function vxworksReleaseFileId (line 40372) | static void vxworksReleaseFileId(struct vxworksFileId *pId){
  type unixFileId (line 40484) | struct unixFileId {
  type unixInodeInfo (line 40525) | struct unixInodeInfo {
  function unixFileMutexHeld (line 40559) | int unixFileMutexHeld(unixFile *pFile){
  function unixFileMutexNotheld (line 40563) | int unixFileMutexNotheld(unixFile *pFile){
  function unixLogErrorAtLine (line 40586) | static int unixLogErrorAtLine(
  function robust_close (line 40655) | static void robust_close(unixFile *pFile, int h, int lineno){
  function storeLastErrno (line 40666) | static void storeLastErrno(unixFile *pFile, int error){
  function closePendingFds (line 40673) | static void closePendingFds(unixFile *pFile){
  function releaseInodeInfo (line 40692) | static void releaseInodeInfo(unixFile *pFile){
  function findInodeInfo (line 40729) | static int findInodeInfo(
  function fileHasMoved (line 40825) | static int fileHasMoved(unixFile *pFile){
  function verifyDbFile (line 40846) | static void verifyDbFile(unixFile *pFile){
  function unixCheckReservedLock (line 40879) | static int unixCheckReservedLock(sqlite3_file *id, int *pResOut){
  function osSetPosixAdvisoryLock (line 40939) | static int osSetPosixAdvisoryLock(
  function unixFileLock (line 41004) | static int unixFileLock(unixFile *pFile, struct flock *pLock){
  function unixLock (line 41068) | static int unixLock(sqlite3_file *id, int eFileLock){
  function setPendingFd (line 41303) | static void setPendingFd(unixFile *pFile){
  function posixUnlock (line 41326) | static int posixUnlock(sqlite3_file *id, int eFileLock, int handleNFSUnl...
  function unixUnlock (line 41486) | static int unixUnlock(sqlite3_file *id, int eFileLock){
  function closeUnixFile (line 41508) | static int closeUnixFile(sqlite3_file *id){
  function unixClose (line 41543) | static int unixClose(sqlite3_file *id){
  function nolockCheckReservedLock (line 41595) | static int nolockCheckReservedLock(sqlite3_file *NotUsed, int *pResOut){
  function nolockLock (line 41600) | static int nolockLock(sqlite3_file *NotUsed, int NotUsed2){
  function nolockUnlock (line 41604) | static int nolockUnlock(sqlite3_file *NotUsed, int NotUsed2){
  function nolockClose (line 41612) | static int nolockClose(sqlite3_file *id) {
  function dotlockCheckReservedLock (line 41654) | static int dotlockCheckReservedLock(sqlite3_file *id, int *pResOut) {
  function dotlockLock (line 41694) | static int dotlockLock(sqlite3_file *id, int eFileLock) {
  function dotlockUnlock (line 41744) | static int dotlockUnlock(sqlite3_file *id, int eFileLock) {
  function dotlockClose (line 41787) | static int dotlockClose(sqlite3_file *id) {
  function robust_flock (line 41817) | static int robust_flock(int fd, int op){
  function flockCheckReservedLock (line 41833) | static int flockCheckReservedLock(sqlite3_file *id, int *pResOut){
  function flockLock (line 41892) | static int flockLock(sqlite3_file *id, int eFileLock) {
  function flockUnlock (line 41936) | static int flockUnlock(sqlite3_file *id, int eFileLock) {
  function flockClose (line 41970) | static int flockClose(sqlite3_file *id) {
  function semXCheckReservedLock (line 41999) | static int semXCheckReservedLock(sqlite3_file *id, int *pResOut) {
  function semXLock (line 42066) | static int semXLock(sqlite3_file *id, int eFileLock) {
  function semXUnlock (line 42099) | static int semXUnlock(sqlite3_file *id, int eFileLock) {
  function semXClose (line 42136) | static int semXClose(sqlite3_file *id) {
  type afpLockingContext (line 42172) | typedef struct afpLockingContext afpLockingContext;
  type afpLockingContext (line 42173) | struct afpLockingContext {
  type ByteRangeLockPB2 (line 42178) | struct ByteRangeLockPB2
  function afpSetLock (line 42196) | static int afpSetLock(
  function afpCheckReservedLock (line 42242) | static int afpCheckReservedLock(sqlite3_file *id, int *pResOut){
  function afpLock (line 42311) | static int afpLock(sqlite3_file *id, int eFileLock){
  function afpUnlock (line 42493) | static int afpUnlock(sqlite3_file *id, int eFileLock) {
  function afpClose (line 42587) | static int afpClose(sqlite3_file *id) {
  function nfsUnlock (line 42635) | static int nfsUnlock(sqlite3_file *id, int eFileLock){
  function seekAndRead (line 42665) | static int seekAndRead(unixFile *id, sqlite3_int64 offset, void *pBuf, i...
  function unixRead (line 42714) | static int unixRead(
  function seekAndWriteFd (line 42790) | static int seekAndWriteFd(
  function seekAndWrite (line 42836) | static int seekAndWrite(unixFile *id, i64 offset, const void *pBuf, int ...
  function unixWrite (line 42845) | static int unixWrite(
  function full_fsync (line 42980) | static int full_fsync(int fd, int fullSync, int dataOnly){
  function openDirectory (line 43076) | static int openDirectory(const char *zFilename, int *pFd){
  function unixSync (line 43113) | static int unixSync(sqlite3_file *id, int flags){
  function unixTruncate (line 43163) | static int unixTruncate(sqlite3_file *id, i64 nByte){
  function unixFileSize (line 43213) | static int unixFileSize(sqlite3_file *id, i64 *pSize){
  function fcntlSizeHint (line 43251) | static int fcntlSizeHint(unixFile *pFile, i64 nByte){
  function unixModeBit (line 43320) | static void unixModeBit(unixFile *pFile, unsigned char mask, int *pArg){
  function unixFileControl (line 43343) | static int unixFileControl(sqlite3_file *id, int op, void *pArg){
  function setDeviceCharacteristics (line 43555) | static void setDeviceCharacteristics(unixFile *pFd){
  function setDeviceCharacteristics (line 43581) | static void setDeviceCharacteristics(unixFile *pFile){
  function unixSectorSize (line 43663) | static int unixSectorSize(sqlite3_file *id){
  function unixDeviceCharacteristics (line 43682) | static int unixDeviceCharacteristics(sqlite3_file *id){
  function unixGetpagesize (line 43696) | static int unixGetpagesize(void){
  type unixShmNode (line 43758) | struct unixShmNode {
  type unixShm (line 43792) | struct unixShm {
  function unixDescribeShm (line 43811) | static void unixDescribeShm(sqlite3_str *pStr, unixShm *pShm){
  function unixFcntlExternalReader (line 43835) | static int unixFcntlExternalReader(unixFile *pFile, int *piOut){
  function unixIsSharingShmNode (line 43881) | static int unixIsSharingShmNode(unixFile *pFile){
  function unixShmSystemLock (line 43905) | static int unixShmSystemLock(
  function unixShmRegionPerMap (line 43999) | static int unixShmRegionPerMap(void){
  function unixShmPurge (line 44013) | static void unixShmPurge(unixFile *pFd){
  function unixLockSharedMemory (line 44052) | static int unixLockSharedMemory(unixFile *pDbFd, unixShmNode *pShmNode){
  function unixOpenSharedMemory (line 44154) | static int unixOpenSharedMemory(unixFile *pDbFd){
  function unixShmMap (line 44308) | static int unixShmMap(
  function assertLockingArrayOk (line 44451) | static int assertLockingArrayOk(unixShmNode *pShmNode){
  function unixShmLock (line 44486) | static int unixShmLock(
  function unixShmBarrier (line 44686) | static void unixShmBarrier(
  function unixShmUnmap (line 44705) | static int unixShmUnmap(
  function unixUnmapfile (line 44762) | static void unixUnmapfile(unixFile *pFd){
  function unixRemapfile (line 44787) | static void unixRemapfile(
  function unixMapfile (line 44879) | static int unixMapfile(unixFile *pFd, i64 nMap){
  function unixFetch (line 44916) | static int unixFetch(sqlite3_file *fd, i64 iOff, int nAmt, void **pp){
  function unixUnfetch (line 44952) | static int unixUnfetch(sqlite3_file *fd, i64 iOff, void *p){
  function sqlite3_io_methods (line 45172) | static const sqlite3_io_methods *autolockIoFinderImpl(
  function sqlite3_io_methods (line 45236) | static const sqlite3_io_methods *vxworksIoFinderImpl(
  type sqlite3_io_methods (line 45269) | typedef const sqlite3_io_methods *(*finder_type)(const char*,unixFile*);
  function fillInUnixFile (line 45282) | static int fillInUnixFile(
  function unixTempFileInit (line 45476) | static void unixTempFileInit(void){
  type stat (line 45487) | struct stat
  function unixGetTempname (line 45512) | static int unixGetTempname(int nBuf, char *zBuf){
  function UnixUnusedFd (line 45571) | static UnixUnusedFd *findReusableFd(const char *zPath, int flags){
  function getFileMode (line 45621) | static int getFileMode(
  function findCreateFileMode (line 45660) | static int findCreateFileMode(
  function unixOpen (line 45740) | static int unixOpen(
  function unixDelete (line 46035) | static int unixDelete(
  function unixAccess (line 46083) | static int unixAccess(
  type DbPath (line 46110) | typedef struct DbPath DbPath;
  type DbPath (line 46111) | struct DbPath {
  function appendOnePathElement (line 46125) | static void appendOnePathElement(
  function appendAllPathElements (line 46186) | static void appendAllPathElements(
  function unixFullPathname (line 46210) | static int unixFullPathname(
  function unixDlError (line 46255) | static void unixDlError(sqlite3_vfs *NotUsed, int nBuf, char *zBufOut){
  function unixDlClose (line 46288) | static void unixDlClose(sqlite3_vfs *NotUsed, void *pHandle){
  function unixRandomness (line 46302) | static int unixRandomness(sqlite3_vfs *NotUsed, int nBuf, char *zBuf){
  function unixSleep (line 46349) | static int unixSleep(sqlite3_vfs *NotUsed, int microseconds){
  function unixCurrentTimeInt64 (line 46395) | static int unixCurrentTimeInt64(sqlite3_vfs *NotUsed, sqlite3_int64 *piN...
  function unixCurrentTime (line 46427) | static int unixCurrentTime(sqlite3_vfs *NotUsed, double *prNow){
  function unixGetLastError (line 46445) | static int unixGetLastError(sqlite3_vfs *NotUsed, int NotUsed2, char *No...
  type proxyLockingContext (line 46616) | typedef struct proxyLockingContext proxyLockingContext;
  type proxyLockingContext (line 46617) | struct proxyLockingContext {
  function proxyGetLockPath (line 46634) | static int proxyGetLockPath(const char *dbPath, char *lPath, size_t maxL...
  function proxyCreateLockPath (line 46675) | static int proxyCreateLockPath(const char *lockPath){
  function proxyCreateUnixFile (line 46715) | static int proxyCreateUnixFile(
  type timespec (line 46806) | struct timespec
  function proxyGetHostID (line 46812) | static int proxyGetHostID(unsigned char *pHostID, int *pError){
  function proxyBreakConchLock (line 46852) | static int proxyBreakConchLock(unixFile *pFile, uuid_t myHostID){
  function proxyConchLock (line 46912) | static int proxyConchLock(unixFile *pFile, uuid_t myHostID, int lockType){
  function proxyTakeConch (line 46990) | static int proxyTakeConch(unixFile *pFile){
  function proxyReleaseConch (line 47212) | static int proxyReleaseConch(unixFile *pFile){
  function proxyCreateConchPathname (line 47242) | static int proxyCreateConchPathname(char *dbPath, char **pConchPath){
  function switchLockProxyPath (line 47279) | static int switchLockProxyPath(unixFile *pFile, const char *path) {
  function proxyGetDbPathForUnixFile (line 47315) | static int proxyGetDbPathForUnixFile(unixFile *pFile, char *dbPath){
  function proxyTransformUnixFile (line 47346) | static int proxyTransformUnixFile(unixFile *pFile, const char *path) {
  function proxyFileControl (line 47433) | static int proxyFileControl(sqlite3_file *id, int op, void *pArg){
  function proxyCheckReservedLock (line 47506) | static int proxyCheckReservedLock(sqlite3_file *id, int *pResOut) {
  function proxyLock (line 47545) | static int proxyLock(sqlite3_file *id, int eFileLock) {
  function proxyUnlock (line 47569) | static int proxyUnlock(sqlite3_file *id, int eFileLock) {
  function proxyClose (line 47588) | static int proxyClose(sqlite3_file *id) {
  function SQLITE_API (line 47650) | SQLITE_API int sqlite3_os_init(void){
  function SQLITE_API (line 47783) | SQLITE_API int sqlite3_os_end(void){
  type winShm (line 48035) | typedef struct winShm winShm;
  type winShmNode (line 48036) | typedef struct winShmNode winShmNode;
  type winceLock (line 48044) | typedef struct winceLock {
  type winFile (line 48056) | typedef struct winFile winFile;
  type winFile (line 48057) | struct winFile {
  type winVfsAppData (line 48100) | typedef struct winVfsAppData winVfsAppData;
  type winVfsAppData (line 48101) | struct winVfsAppData {
  type winMemData (line 48223) | typedef struct winMemData winMemData;
  type winMemData (line 48224) | struct winMemData {
  type winMemData (line 48240) | struct winMemData
  type win_syscall (line 48309) | struct win_syscall {
  type stat (line 49042) | struct stat
  function winSetSystemCall (line 49069) | static int winSetSystemCall(
  function sqlite3_syscall_ptr (line 49112) | static sqlite3_syscall_ptr winGetSystemCall(
  function SQLITE_API (line 49154) | SQLITE_API int sqlite3_win32_compact_heap(LPUINT pnLargest){
  function SQLITE_API (line 49194) | SQLITE_API int sqlite3_win32_reset_heap(){
  function SQLITE_API (line 49240) | SQLITE_API void sqlite3_win32_write_debug(const char *zBuf, int nBuf){
  function SQLITE_API (line 49287) | SQLITE_API void sqlite3_win32_sleep(DWORD milliseconds){
  function SQLITE_PRIVATE (line 49302) | SQLITE_PRIVATE DWORD sqlite3Win32Wait(HANDLE hObject){
  function SQLITE_API (line 49336) | SQLITE_API int sqlite3_win32_is_nt(void){
  function winMemFree (line 49400) | static void winMemFree(void *pPrior){
  function winMemSize (line 49448) | static int winMemSize(void *p){
  function winMemRoundup (line 49472) | static int winMemRoundup(int n){
  function winMemInit (line 49479) | static int winMemInit(void *pAppData){
  function winMemShutdown (line 49528) | static void winMemShutdown(void *pAppData){
  function SQLITE_PRIVATE (line 49559) | SQLITE_PRIVATE const sqlite3_mem_methods *sqlite3MemGetWin32(void){
  function SQLITE_PRIVATE (line 49573) | SQLITE_PRIVATE void sqlite3MemSetDefault(void){
  function LPWSTR (line 49584) | static LPWSTR winUtf8ToUnicode(const char *zText){
  function LPWSTR (line 49638) | static LPWSTR winMbcsToUnicode(const char *zText, int useAnsi){
  function SQLITE_API (line 49731) | SQLITE_API LPWSTR sqlite3_win32_utf8_to_unicode(const char *zText){
  function SQLITE_API (line 49747) | SQLITE_API char *sqlite3_win32_unicode_to_utf8(LPCWSTR zWideText){
  function SQLITE_API (line 49764) | SQLITE_API char *sqlite3_win32_mbcs_to_utf8(const char *zText){
  function SQLITE_API (line 49781) | SQLITE_API char *sqlite3_win32_mbcs_to_utf8_v2(const char *zText, int us...
  function SQLITE_API (line 49797) | SQLITE_API char *sqlite3_win32_utf8_to_mbcs(const char *zText){
  function SQLITE_API (line 49813) | SQLITE_API char *sqlite3_win32_utf8_to_mbcs_v2(const char *zText, int us...
  function SQLITE_API (line 49830) | SQLITE_API int sqlite3_win32_set_directory8(
  function SQLITE_API (line 49874) | SQLITE_API int sqlite3_win32_set_directory16(
  function SQLITE_API (line 49896) | SQLITE_API int sqlite3_win32_set_directory(
  function winGetLastErrorMsg (line 49909) | static int winGetLastErrorMsg(DWORD lastErrno, int nBuf, char *zBuf){
  function winLogErrorAtLine (line 50000) | static int winLogErrorAtLine(
  function winRetryIoerr (line 50070) | static int winRetryIoerr(int *pnRetry, DWORD *pError){
  function winLogIoerr (line 50099) | static void winLogIoerr(int nRetry, int lineno){
  type tm (line 50119) | struct tm
  type tm (line 50121) | struct tm
  function winceMutexAcquire (line 50151) | static void winceMutexAcquire(HANDLE h){
  function winceCreateLock (line 50166) | static int winceCreateLock(const char *zFilename, winFile *pFile){
  function winceDestroyLock (line 50260) | static void winceDestroyLock(winFile *pFile){
  function BOOL (line 50294) | static BOOL winceLockFile(
  function BOOL (line 50360) | static BOOL winceUnlockFile(
  function BOOL (line 50429) | static BOOL winLockFile(
  function winHandleLockTimeout (line 50471) | static int winHandleLockTimeout(
  function BOOL (line 50548) | static BOOL winUnlockFile(
  function winHandleUnlock (line 50582) | static int winHandleUnlock(HANDLE h, int iOff, int nByte){
  function winHandleSeek (line 50606) | static int winHandleSeek(HANDLE h, sqlite3_int64 iOffset){
  function winSeekFile (line 50653) | static int winSeekFile(winFile *pFile, sqlite3_int64 iOffset){
  function winClose (line 50682) | static int winClose(sqlite3_file *id){
  function winWrite (line 50818) | static int winWrite(
  function SQLITE_PRIVATE (line 71049) | SQLITE_PRIVATE int sqlite3WalCheckpoint(
  function SQLITE_PRIVATE (line 71187) | SQLITE_PRIVATE int sqlite3WalCallback(Wal *pWal){
  function SQLITE_PRIVATE (line 71220) | SQLITE_PRIVATE int sqlite3WalExclusiveMode(Wal *pWal, int op){
  function SQLITE_PRIVATE (line 71264) | SQLITE_PRIVATE int sqlite3WalHeapMemory(Wal *pWal){
  function SQLITE_PRIVATE (line 71273) | SQLITE_PRIVATE int sqlite3WalSnapshotGet(Wal *pWal, sqlite3_snapshot **p...
  function SQLITE_PRIVATE (line 71297) | SQLITE_PRIVATE void sqlite3WalSnapshotOpen(
  function SQLITE_API (line 71321) | SQLITE_API int sqlite3_snapshot_cmp(sqlite3_snapshot *p1, sqlite3_snapsh...
  function SQLITE_PRIVATE (line 71345) | SQLITE_PRIVATE int sqlite3WalSnapshotCheck(Wal *pWal, sqlite3_snapshot *...
  function SQLITE_PRIVATE (line 71367) | SQLITE_PRIVATE void sqlite3WalSnapshotUnlock(Wal *pWal){
  function SQLITE_PRIVATE (line 71381) | SQLITE_PRIVATE int sqlite3WalFramesize(Wal *pWal){
  function SQLITE_PRIVATE (line 71389) | SQLITE_PRIVATE sqlite3_file *sqlite3WalFile(Wal *pWal){
  type MemPage (line 71647) | typedef struct MemPage MemPage;
  type BtLock (line 71648) | typedef struct BtLock BtLock;
  type CellInfo (line 71649) | typedef struct CellInfo CellInfo;
  type MemPage (line 71688) | struct MemPage {
  type BtLock (line 71728) | struct BtLock {
  type Btree (line 71760) | struct Btree {
  type BtShared (line 71840) | struct BtShared {
  type CellInfo (line 71895) | struct CellInfo {
  type BtCursor (line 71946) | struct BtCursor {
  type IntegrityCk (line 72114) | typedef struct IntegrityCk IntegrityCk;
  type IntegrityCk (line 72115) | struct IntegrityCk {
  function lockBtreeMutex (line 72167) | static void lockBtreeMutex(Btree *p){
  function unlockBtreeMutex (line 72181) | static void SQLITE_NOINLINE unlockBtreeMutex(Btree *p){
  function SQLITE_PRIVATE (line 72211) | SQLITE_PRIVATE void sqlite3BtreeEnter(Btree *p){
  function btreeLockCarefully (line 72245) | static void SQLITE_NOINLINE btreeLockCarefully(Btree *p){
  function SQLITE_PRIVATE (line 72283) | SQLITE_PRIVATE void sqlite3BtreeLeave(Btree *p){
  function SQLITE_PRIVATE (line 72301) | SQLITE_PRIVATE int sqlite3BtreeHoldsMutex(Btree *p){
  function btreeEnterAll (line 72326) | static void SQLITE_NOINLINE btreeEnterAll(sqlite3 *db){
  function SQLITE_PRIVATE (line 72340) | SQLITE_PRIVATE void sqlite3BtreeEnterAll(sqlite3 *db){
  function btreeLeaveAll (line 72343) | static void SQLITE_NOINLINE btreeLeaveAll(sqlite3 *db){
  function SQLITE_PRIVATE (line 72352) | SQLITE_PRIVATE void sqlite3BtreeLeaveAll(sqlite3 *db){
  function SQLITE_PRIVATE (line 72363) | SQLITE_PRIVATE int sqlite3BtreeHoldsAllMutexes(sqlite3 *db){
  function SQLITE_PRIVATE (line 72392) | SQLITE_PRIVATE int sqlite3SchemaMutexHeld(sqlite3 *db, int iDb, Schema *...
  function SQLITE_PRIVATE (line 72417) | SQLITE_PRIVATE void sqlite3BtreeEnter(Btree *p){
  function SQLITE_PRIVATE (line 72420) | SQLITE_PRIVATE void sqlite3BtreeEnterAll(sqlite3 *db){
  function SQLITE_PRIVATE (line 72439) | SQLITE_PRIVATE void sqlite3BtreeEnterCursor(BtCursor *pCur){
  function SQLITE_PRIVATE (line 72443) | SQLITE_PRIVATE void sqlite3BtreeLeaveCursor(BtCursor *pCur){
  function SQLITE_API (line 72541) | SQLITE_API int sqlite3_enable_shared_cache(int enable){
  function SQLITE_PRIVATE (line 72571) | SQLITE_PRIVATE sqlite3_uint64 sqlite3BtreeSeekCount(Btree *pBt){
  function corruptPageError (line 72588) | int corruptPageError(int lineno, MemPage *p){
  function sharedLockTrace (line 72620) | static void sharedLockTrace(
  function hasSharedCacheTableLock (line 72670) | static int hasSharedCacheTableLock(
  function hasReadConflicts (line 72761) | static int hasReadConflicts(Btree *pBtree, Pgno iRoot){
  function querySharedCacheTableLock (line 72781) | static int querySharedCacheTableLock(Btree *p, Pgno iTab, u8 eLock){
  function setSharedCacheTableLock (line 72853) | static int setSharedCacheTableLock(Btree *p, Pgno iTable, u8 eLock){
  function clearAllSharedCacheTableLocks (line 72919) | static void clearAllSharedCacheTableLocks(Btree *p){
  function downgradeAllSharedCacheTableLocks (line 72965) | static void downgradeAllSharedCacheTableLocks(Btree *p){
  function cursorHoldsMutex (line 72993) | static int cursorHoldsMutex(BtCursor *p){
  function cursorOwnsBtShared (line 73005) | static int cursorOwnsBtShared(BtCursor *p){
  function invalidateAllOverflowCache (line 73021) | static void invalidateAllOverflowCache(BtShared *pBt){
  function invalidateIncrblobCursors (line 73043) | static void invalidateIncrblobCursors(
  function btreeSetHasContent (line 73103) | static int btreeSetHasContent(BtShared *pBt, Pgno pgno){
  function btreeGetHasContent (line 73125) | static int btreeGetHasContent(BtShared *pBt, Pgno pgno){
  function btreeClearHasContent (line 73134) | static void btreeClearHasContent(BtShared *pBt){
  function btreeReleaseAllCursorPages (line 73142) | static void btreeReleaseAllCursorPages(BtCursor *pCur){
  function saveCursorKey (line 73166) | static int saveCursorKey(BtCursor *pCur){
  function saveCursorPosition (line 73208) | static int saveCursorPosition(BtCursor *pCur){
  function saveAllCursors (line 73258) | static int saveAllCursors(BtShared *pBt, Pgno iRoot, BtCursor *pExcept){
  function saveCursorsOnList (line 73275) | static int SQLITE_NOINLINE saveCursorsOnList(
  function SQLITE_PRIVATE (line 73300) | SQLITE_PRIVATE void sqlite3BtreeClearCursor(BtCursor *pCur){
  function btreeMoveto (line 73312) | static int btreeMoveto(
  function btreeRestoreCursorPosition (line 73348) | static int btreeRestoreCursorPosition(BtCursor *pCur){
  function SQLITE_PRIVATE (line 73391) | SQLITE_PRIVATE int sqlite3BtreeCursorHasMoved(BtCursor *pCur){
  function SQLITE_PRIVATE (line 73404) | SQLITE_PRIVATE BtCursor *sqlite3BtreeFakeValidCursor(void){
  function SQLITE_PRIVATE (line 73423) | SQLITE_PRIVATE int sqlite3BtreeCursorRestore(BtCursor *pCur, int *pDiffe...
  function SQLITE_PRIVATE (line 73447) | SQLITE_PRIVATE void sqlite3BtreeCursorHint(BtCursor *pCur, int eHintType...
  function SQLITE_PRIVATE (line 73472) | SQLITE_PRIVATE void sqlite3BtreeCursorHintFlags(BtCursor *pCur, unsigned...
  function Pgno (line 73488) | static Pgno ptrmapPageno(BtShared *pBt, Pgno pgno){
  function ptrmapPut (line 73512) | static void ptrmapPut(BtShared *pBt, Pgno key, u8 eType, Pgno parent, in...
  function ptrmapGet (line 73571) | static int ptrmapGet(BtShared *pBt, Pgno key, u8 *pEType, Pgno *pPgno){
  function SQLITE_NOINLINE (line 73630) | static SQLITE_NOINLINE void btreeParseCellAdjustSizeForOverflow(
  function btreePayloadToLocal (line 73665) | static int btreePayloadToLocal(MemPage *pPage, i64 nPayload){
  function btreeParseCellPtrNoPayload (line 73694) | static void btreeParseCellPtrNoPayload(
  function btreeParseCellPtr (line 73711) | static void btreeParseCellPtr(
  function btreeParseCellPtrIndex (line 73799) | static void btreeParseCellPtrIndex(
  function btreeParseCell (line 73838) | static void btreeParseCell(
  function u16 (line 73860) | static u16 cellSizePtr(MemPage *pPage, u8 *pCell){
  function u16 (line 73902) | static u16 cellSizePtrIdxLeaf(MemPage *pPage, u8 *pCell){
  function u16 (line 73944) | static u16 cellSizePtrNoPayload(MemPage *pPage, u8 *pCell){
  function u16 (line 73965) | static u16 cellSizePtrTableLeaf(MemPage *pPage, u8 *pCell){
  function u16 (line 74022) | static u16 cellSize(MemPage *pPage, int iCell){
  function ptrmapPutOvflPtr (line 74034) | static void ptrmapPutOvflPtr(MemPage *pPage, MemPage *pSrc, u8 *pCell,in...
  function defragmentPage (line 74065) | static int defragmentPage(MemPage *pPage, int nMaxFrag){
  function u8 (line 74199) | static u8 *pageFindSlot(MemPage *pPg, int nByte, int *pRc){
  function SQLITE_INLINE (line 74271) | static SQLITE_INLINE int allocateSpace(MemPage *pPage, int nByte, int *p...
  function freeSpace (line 74370) | static int freeSpace(MemPage *pPage, int iStart, int iSize){
  function decodeFlags (line 74480) | static int decodeFlags(MemPage *pPage, int flagByte){
  function btreeComputeFreeSpace (line 74543) | static int btreeComputeFreeSpace(MemPage *pPage){
  function SQLITE_NOINLINE (line 74625) | static SQLITE_NOINLINE int btreeCellSizeCheck(MemPage *pPage){
  function btreeInitPage (line 74666) | static int btreeInitPage(MemPage *pPage){
  function zeroPage (line 74719) | static void zeroPage(MemPage *pPage, int flags){
  function MemPage (line 74756) | static MemPage *btreePageFromDbPage(DbPage *pDbPage, Pgno pgno, BtShared...
  function btreeGetPage (line 74780) | static int btreeGetPage(
  function MemPage (line 74802) | static MemPage *btreePageLookup(BtShared *pBt, Pgno pgno){
  function Pgno (line 74816) | static Pgno btreePagecount(BtShared *pBt){
  function SQLITE_PRIVATE (line 74819) | SQLITE_PRIVATE Pgno sqlite3BtreeLastPage(Btree *p){
  function getAndInitPage (line 74827) | static int getAndInitPage(
  function releasePageNotNull (line 74869) | static void releasePageNotNull(MemPage *pPage){
  function releasePage (line 74878) | static void releasePage(MemPage *pPage){
  function releasePageOne (line 74881) | static void releasePageOne(MemPage *pPage){
  function btreeGetUnusedPage (line 74901) | static int btreeGetUnusedPage(
  function pageReinit (line 74930) | static void pageReinit(DbPage *pData){
  function btreeInvokeBusyHandler (line 74952) | static int btreeInvokeBusyHandler(void *pArg){
  function SQLITE_PRIVATE (line 74980) | SQLITE_PRIVATE int sqlite3BtreeOpen(
  function removeFromSharingList (line 75281) | static int removeFromSharingList(BtShared *pBt){
  function SQLITE_NOINLINE (line 75321) | static SQLITE_NOINLINE int allocateTempSpace(BtShared *pBt){
  function freeTempSpace (line 75358) | static void freeTempSpace(BtShared *pBt){
  function SQLITE_PRIVATE (line 75369) | SQLITE_PRIVATE int sqlite3BtreeClose(Btree *p){
  function SQLITE_PRIVATE (line 75435) | SQLITE_PRIVATE int sqlite3BtreeSetCacheSize(Btree *p, int mxPage){
  function SQLITE_PRIVATE (line 75454) | SQLITE_PRIVATE int sqlite3BtreeSetSpillSize(Btree *p, int mxPage){
  function SQLITE_PRIVATE (line 75469) | SQLITE_PRIVATE int sqlite3BtreeSetMmapLimit(Btree *p, sqlite3_int64 szMm...
  function SQLITE_PRIVATE (line 75488) | SQLITE_PRIVATE int sqlite3BtreeSetPagerFlags(
  function SQLITE_PRIVATE (line 75521) | SQLITE_PRIVATE int sqlite3BtreeSetPageSize(Btree *p, int pageSize, int n...
  function SQLITE_PRIVATE (line 75557) | SQLITE_PRIVATE int sqlite3BtreeGetPageSize(Btree *p){
  function SQLITE_PRIVATE (line 75572) | SQLITE_PRIVATE int sqlite3BtreeGetReserveNoMutex(Btree *p){
  function SQLITE_PRIVATE (line 75588) | SQLITE_PRIVATE int sqlite3BtreeGetRequestedReserve(Btree *p){
  function SQLITE_PRIVATE (line 75603) | SQLITE_PRIVATE Pgno sqlite3BtreeMaxPageCount(Btree *p, Pgno mxPage){
  function SQLITE_PRIVATE (line 75629) | SQLITE_PRIVATE int sqlite3BtreeSecureDelete(Btree *p, int newFlag){
  function SQLITE_PRIVATE (line 75650) | SQLITE_PRIVATE int sqlite3BtreeSetAutoVacuum(Btree *p, int autoVacuum){
  function SQLITE_PRIVATE (line 75674) | SQLITE_PRIVATE int sqlite3BtreeGetAutoVacuum(Btree *p){
  function setDefaultSyncFlag (line 75698) | static void setDefaultSyncFlag(BtShared *pBt, u8 safety_level){
  function lockBtree (line 75730) | static int lockBtree(BtShared *pBt){
  function countValidCursors (line 75922) | static int countValidCursors(BtShared *pBt, int wrOnly){
  function unlockBtreeIfUnused (line 75941) | static void unlockBtreeIfUnused(BtShared *pBt){
  function newDatabase (line 75958) | static int newDatabase(BtShared *pBt){
  function SQLITE_PRIVATE (line 76002) | SQLITE_PRIVATE int sqlite3BtreeNewDb(Btree *p){
  function SQLITE_NOINLINE (line 76046) | static SQLITE_NOINLINE int btreeBeginTrans(
  function SQLITE_PRIVATE (line 76229) | SQLITE_PRIVATE int sqlite3BtreeBeginTrans(Btree *p, int wrflag, int *pSc...
  function setChildPtrmaps (line 76259) | static int setChildPtrmaps(MemPage *pPage){
  function modifyPagePointer (line 76304) | static int modifyPagePointer(MemPage *pPage, Pgno iFrom, Pgno iTo, u8 eT...
  function relocatePage (line 76368) | static int relocatePage(
  function incrVacuumStep (line 76462) | static int incrVacuumStep(BtShared *pBt, Pgno nFin, Pgno iLastPg, int bC...
  function Pgno (line 76563) | static Pgno finalDbSize(BtShared *pBt, Pgno nOrig, Pgno nFree){
  function SQLITE_PRIVATE (line 76589) | SQLITE_PRIVATE int sqlite3BtreeIncrVacuum(Btree *p){
  function autoVacuumCommit (line 76626) | static int autoVacuumCommit(Btree *p){
  function SQLITE_PRIVATE (line 76737) | SQLITE_PRIVATE int sqlite3BtreeCommitPhaseOne(Btree *p, const char *zSup...
  function btreeEndTransaction (line 76764) | static void btreeEndTransaction(Btree *p){
  function SQLITE_PRIVATE (line 76826) | SQLITE_PRIVATE int sqlite3BtreeCommitPhaseTwo(Btree *p, int bCleanup){
  function SQLITE_PRIVATE (line 76858) | SQLITE_PRIVATE int sqlite3BtreeCommit(Btree *p){
  function SQLITE_PRIVATE (line 76895) | SQLITE_PRIVATE int sqlite3BtreeTripAllCursors(Btree *pBtree, int errCode...
  function btreeSetNPage (line 76927) | static void btreeSetNPage(BtShared *pBt, MemPage *pPage1){
  function SQLITE_PRIVATE (line 76946) | SQLITE_PRIVATE int sqlite3BtreeRollback(Btree *p, int tripCode, int writ...
  function SQLITE_PRIVATE (line 77011) | SQLITE_PRIVATE int sqlite3BtreeBeginStmt(Btree *p, int iStatement){
  function SQLITE_PRIVATE (line 77042) | SQLITE_PRIVATE int sqlite3BtreeSavepoint(Btree *p, int op, int iSavepoint){
  function btreeCursor (line 77113) | static int btreeCursor(
  function btreeCursorWithLock (line 77180) | static int btreeCursorWithLock(
  function SQLITE_PRIVATE (line 77193) | SQLITE_PRIVATE int sqlite3BtreeCursor(
  function SQLITE_PRIVATE (line 77215) | SQLITE_PRIVATE int sqlite3BtreeCursorSize(void){
  function SQLITE_PRIVATE (line 77225) | SQLITE_PRIVATE int sqlite3BtreeClosesWithCursor(
  function SQLITE_PRIVATE (line 77246) | SQLITE_PRIVATE void sqlite3BtreeCursorZero(BtCursor *p){
  function SQLITE_PRIVATE (line 77254) | SQLITE_PRIVATE int sqlite3BtreeCloseCursor(BtCursor *pCur){
  function cellInfoEqual (line 77298) | static int cellInfoEqual(CellInfo *a, CellInfo *b){
  function assertCellInfo (line 77306) | static void assertCellInfo(BtCursor *pCur){
  function SQLITE_NOINLINE (line 77315) | static SQLITE_NOINLINE void getCellInfo(BtCursor *pCur){
  function SQLITE_PRIVATE (line 77330) | SQLITE_PRIVATE int sqlite3BtreeCursorIsValid(BtCursor *pCur){
  function SQLITE_PRIVATE (line 77334) | SQLITE_PRIVATE int sqlite3BtreeCursorIsValidNN(BtCursor *pCur){
  function SQLITE_PRIVATE (line 77345) | SQLITE_PRIVATE i64 sqlite3BtreeIntegerKey(BtCursor *pCur){
  function SQLITE_PRIVATE (line 77356) | SQLITE_PRIVATE void sqlite3BtreeCursorPin(BtCursor *pCur){
  function SQLITE_PRIVATE (line 77360) | SQLITE_PRIVATE void sqlite3BtreeCursorUnpin(BtCursor *pCur){
  function SQLITE_PRIVATE (line 77369) | SQLITE_PRIVATE i64 sqlite3BtreeOffset(BtCursor *pCur){
  function SQLITE_PRIVATE (line 77386) | SQLITE_PRIVATE u32 sqlite3BtreePayloadSize(BtCursor *pCur){
  function SQLITE_PRIVATE (line 77406) | SQLITE_PRIVATE sqlite3_int64 sqlite3BtreeMaxRecordSize(BtCursor *pCur){
  function getOverflowPage (line 77431) | static int getOverflowPage(
  function copyPayload (line 77499) | static int copyPayload(
  function accessPayload (line 77549) | static int accessPayload(
  function SQLITE_PRIVATE (line 77761) | SQLITE_PRIVATE int sqlite3BtreePayload(BtCursor *pCur, u32 offset, u32 a...
  function SQLITE_NOINLINE (line 77774) | static SQLITE_NOINLINE int accessPayloadChecked(
  function SQLITE_PRIVATE (line 77788) | SQLITE_PRIVATE int sqlite3BtreePayloadChecked(BtCursor *pCur, u32 offset...
  function SQLITE_PRIVATE (line 77856) | SQLITE_PRIVATE const void *sqlite3BtreePayloadFetch(BtCursor *pCur, u32 ...
  function moveToChild (line 77870) | static int moveToChild(BtCursor *pCur, u32 newPgno){
  function assertParentIndex (line 77907) | static void assertParentIndex(MemPage *pParent, int iIdx, Pgno iChild){
  function moveToParent (line 77929) | static void moveToParent(BtCursor *pCur){
  function moveToRoot (line 77970) | static int moveToRoot(BtCursor *pCur){
  function moveToLeftmost (line 78056) | static int moveToLeftmost(BtCursor *pCur){
  function moveToRightmost (line 78081) | static int moveToRightmost(BtCursor *pCur){
  function SQLITE_PRIVATE (line 78104) | SQLITE_PRIVATE int sqlite3BtreeFirst(BtCursor *pCur, int *pRes){
  function SQLITE_PRIVATE (line 78127) | SQLITE_PRIVATE int sqlite3BtreeIsEmpty(BtCursor *pCur, int *pRes){
  function cursorIsAtLastEntry (line 78154) | static int cursorIsAtLastEntry(BtCursor *pCur){
  function SQLITE_NOINLINE (line 78167) | static SQLITE_NOINLINE int btreeLast(BtCursor *pCur, int *pRes){
  function SQLITE_PRIVATE (line 78185) | SQLITE_PRIVATE int sqlite3BtreeLast(BtCursor *pCur, int *pRes){
  function SQLITE_PRIVATE (line 78221) | SQLITE_PRIVATE int sqlite3BtreeTableMoveto(
  function indexCellCompare (line 78380) | static int indexCellCompare(
  function cursorOnLastPage (line 78416) | static int cursorOnLastPage(BtCursor *pCur){
  function SQLITE_PRIVATE (line 78452) | SQLITE_PRIVATE int sqlite3BtreeIndexMoveto(
  function SQLITE_PRIVATE (line 78690) | SQLITE_PRIVATE int sqlite3BtreeEof(BtCursor *pCur){
  function SQLITE_PRIVATE (line 78703) | SQLITE_PRIVATE i64 sqlite3BtreeRowCountEst(BtCursor *pCur){
  function SQLITE_NOINLINE (line 78743) | static SQLITE_NOINLINE int btreeNext(BtCursor *pCur){
  function SQLITE_PRIVATE (line 78797) | SQLITE_PRIVATE int sqlite3BtreeNext(BtCursor *pCur, int flags){
  function SQLITE_NOINLINE (line 78837) | static SQLITE_NOINLINE int btreePrevious(BtCursor *pCur){
  function SQLITE_PRIVATE (line 78889) | SQLITE_PRIVATE int sqlite3BtreePrevious(BtCursor *pCur, int flags){
  function allocateBtreePage (line 78927) | static int allocateBtreePage(
  function freePage2 (line 79249) | static int freePage2(BtShared *pBt, MemPage *pMemPage, Pgno iPage){
  function freePage (line 79383) | static void freePage(MemPage *pPage, int *pRC){
  function SQLITE_NOINLINE (line 79392) | static SQLITE_NOINLINE int clearCellOverflow(
  function fillInCell (line 79487) | static int fillInCell(
  function dropCell (line 79680) | static void dropCell(MemPage *pPage, int idx, int sz, int *pRC){
  function insertCell (line 79744) | static int insertCell(
  function insertCellFast (line 79841) | static int insertCellFast(
  type CellArray (line 79998) | typedef struct CellArray CellArray;
  type CellArray (line 79999) | struct CellArray {
  function populateCellCache (line 80012) | static void populateCellCache(CellArray *p, int idx, int N){
  function SQLITE_NOINLINE (line 80032) | static SQLITE_NOINLINE u16 computeCellSize(CellArray *p, int N){
  function u16 (line 80038) | static u16 cachedCellSize(CellArray *p, int N){
  function rebuildPage (line 80057) | static int rebuildPage(
  function pageInsertArray (line 80150) | static int pageInsertArray(
  function pageFreeArray (line 80216) | static int pageFreeArray(
  function editPage (line 80286) | static int editPage(
  function balance_quick (line 80420) | static int balance_quick(MemPage *pParent, MemPage *pPage, u8 *pSpace){
  function ptrmapCheckPages (line 80523) | static int ptrmapCheckPages(MemPage **apPage, int nPage){
  function copyNodeContent (line 80576) | static void copyNodeContent(MemPage *pFrom, MemPage *pTo, int *pRC){
  function balance_nonroot (line 80658) | static int balance_nonroot(
  function balance_deeper (line 81462) | static int balance_deeper(MemPage *pRoot, MemPage **ppChild){
  function anotherValidCursor (line 81520) | static int anotherValidCursor(BtCursor *pCur){
  function balance (line 81543) | static int balance(BtCursor *pCur){
  function btreeOverwriteContent (line 81677) | static int btreeOverwriteContent(
  function SQLITE_NOINLINE (line 81721) | static SQLITE_NOINLINE int btreeOverwriteOverflowCell(
  function btreeOverwriteCell (line 81772) | static int btreeOverwriteCell(BtCursor *pCur, const BtreePayload *pX){
  function SQLITE_PRIVATE (line 81822) | SQLITE_PRIVATE int sqlite3BtreeInsert(
  function SQLITE_PRIVATE (line 82140) | SQLITE_PRIVATE int sqlite3BtreeTransferRow(BtCursor *pDest, BtCursor *pS...
  function SQLITE_PRIVATE (line 82254) | SQLITE_PRIVATE int sqlite3BtreeDelete(BtCursor *pCur, u8 flags){
  function btreeCreateTable (line 82467) | static int btreeCreateTable(Btree *p, Pgno *piTable, int createTabFlags){
  function SQLITE_PRIVATE (line 82612) | SQLITE_PRIVATE int sqlite3BtreeCreateTable(Btree *p, Pgno *piTable, int ...
  function clearDatabasePage (line 82624) | static int clearDatabasePage(
  function SQLITE_PRIVATE (line 82691) | SQLITE_PRIVATE int sqlite3BtreeClearTable(Btree *p, int iTable, i64 *pnC...
  function SQLITE_PRIVATE (line 82717) | SQLITE_PRIVATE int sqlite3BtreeClearTableOfCursor(BtCursor *pCur){
  function btreeDropTable (line 82741) | static int btreeDropTable(Btree *p, Pgno iTable, int *piMoved){
  function SQLITE_PRIVATE (line 82826) | SQLITE_PRIVATE int sqlite3BtreeDropTable(Btree *p, int iTable, int *piMo...
  function SQLITE_PRIVATE (line 82855) | SQLITE_PRIVATE void sqlite3BtreeGetMeta(Btree *p, int idx, u32 *pMeta){
  function SQLITE_PRIVATE (line 82885) | SQLITE_PRIVATE int sqlite3BtreeUpdateMeta(Btree *p, int idx, u32 iMeta){
  function SQLITE_PRIVATE (line 82917) | SQLITE_PRIVATE int sqlite3BtreeCount(sqlite3 *db, BtCursor *pCur, i64 *p...
  function SQLITE_PRIVATE (line 82986) | SQLITE_PRIVATE Pager *sqlite3BtreePager(Btree *p){
  function checkOom (line 82994) | static void checkOom(IntegrityCk *pCheck){
  function checkProgress (line 83004) | static void checkProgress(IntegrityCk *pCheck){
  function checkAppendMsg (line 83029) | static void checkAppendMsg(
  function getPageReferenced (line 83061) | static int getPageReferenced(IntegrityCk *pCheck, Pgno iPg){
  function setPageReferenced (line 83070) | static void setPageReferenced(IntegrityCk *pCheck, Pgno iPg){
  function checkRef (line 83085) | static int checkRef(IntegrityCk *pCheck, Pgno iPage){
  function checkPtrmap (line 83104) | static void checkPtrmap(
  function checkList (line 83133) | static void checkList(
  function btreeHeapInsert (line 83222) | static void btreeHeapInsert(u32 *aHeap, u32 x){
  function btreeHeapPull (line 83234) | static int btreeHeapPull(u32 *aHeap, u32 *pOut){
  function checkTreePage (line 83268) | static int checkTreePage(
  function SQLITE_PRIVATE (line 83554) | SQLITE_PRIVATE int sqlite3BtreeIntegrityCheck(
  function SQLITE_PRIVATE (line 83712) | SQLITE_PRIVATE const char *sqlite3BtreeGetFilename(Btree *p){
  function SQLITE_PRIVATE (line 83725) | SQLITE_PRIVATE const char *sqlite3BtreeGetJournalname(Btree *p){
  function SQLITE_PRIVATE (line 83734) | SQLITE_PRIVATE int sqlite3BtreeTxnState(Btree *p){
  function SQLITE_PRIVATE (line 83748) | SQLITE_PRIVATE int sqlite3BtreeCheckpoint(Btree *p, int eMode, int *pnLo...
  function SQLITE_PRIVATE (line 83767) | SQLITE_PRIVATE int sqlite3BtreeIsInBackup(Btree *p){
  function SQLITE_PRIVATE (line 83793) | SQLITE_PRIVATE void *sqlite3BtreeSchema(Btree *p, int nBytes, void(*xFre...
  function SQLITE_PRIVATE (line 83810) | SQLITE_PRIVATE int sqlite3BtreeSchemaLocked(Btree *p){
  function SQLITE_PRIVATE (line 83828) | SQLITE_PRIVATE int sqlite3BtreeLockTable(Btree *p, int iTab, u8 isWriteL...
  function SQLITE_PRIVATE (line 83858) | SQLITE_PRIVATE int sqlite3BtreePutData(BtCursor *pCsr, u32 offset, u32 a...
  function SQLITE_PRIVATE (line 83906) | SQLITE_PRIVATE void sqlite3BtreeIncrblobCursor(BtCursor *pCur){
  function SQLITE_PRIVATE (line 83917) | SQLITE_PRIVATE int sqlite3BtreeSetVersion(Btree *pBtree, int iVersion){
  function SQLITE_PRIVATE (line 83952) | SQLITE_PRIVATE int sqlite3BtreeCursorHasHint(BtCursor *pCsr, unsigned in...
  function SQLITE_PRIVATE (line 83959) | SQLITE_PRIVATE int sqlite3BtreeIsReadonly(Btree *p){
  function SQLITE_PRIVATE (line 83966) | SQLITE_PRIVATE int sqlite3HeaderSizeBtree(void){ return ROUND8(sizeof(Me...
  function SQLITE_PRIVATE (line 83972) | SQLITE_PRIVATE void sqlite3BtreeClearCache(Btree *p){
  function SQLITE_PRIVATE (line 83983) | SQLITE_PRIVATE int sqlite3BtreeSharable(Btree *p){
  function SQLITE_PRIVATE (line 83992) | SQLITE_PRIVATE int sqlite3BtreeConnectionCount(Btree *p){
  type sqlite3_backup (line 84020) | struct sqlite3_backup {
  function Btree (line 84081) | static Btree *findBtree(sqlite3 *pErrorDb, sqlite3 *pDb, const char *zDb){
  function setDestPgsz (line 84111) | static int setDestPgsz(sqlite3_backup *p){
  function checkReadTransaction (line 84123) | static int checkReadTransaction(sqlite3 *db, Btree *p){
  function SQLITE_API (line 84139) | SQLITE_API sqlite3_backup *sqlite3_backup_init(
  function isFatalError (line 84216) | static int isFatalError(int rc){
  function backupOnePage (line 84225) | static int backupOnePage(
  function backupTruncateFile (line 84288) | static int backupTruncateFile(sqlite3_file *pFile, i64 iSize){
  function attachBackupObject (line 84301) | static void attachBackupObject(sqlite3_backup *p){
  function SQLITE_API (line 84313) | SQLITE_API int sqlite3_backup_step(sqlite3_backup *p, int nPage){
  function SQLITE_API (line 84570) | SQLITE_API int sqlite3_backup_finish(sqlite3_backup *p){
  function SQLITE_API (line 84624) | SQLITE_API int sqlite3_backup_remaining(sqlite3_backup *p){
  function SQLITE_API (line 84638) | SQLITE_API int sqlite3_backup_pagecount(sqlite3_backup *p){
  function SQLITE_NOINLINE (line 84660) | static SQLITE_NOINLINE void backupUpdate(
  function SQLITE_PRIVATE (line 84685) | SQLITE_PRIVATE void sqlite3BackupUpdate(sqlite3_backup *pBackup, Pgno iP...
  function SQLITE_PRIVATE (line 84700) | SQLITE_PRIVATE void sqlite3BackupRestart(sqlite3_backup *pBackup){
  function SQLITE_PRIVATE (line 84717) | SQLITE_PRIVATE int sqlite3BtreeCopyFile(Btree *pTo, Btree *pFrom){
  function SQLITE_PRIVATE (line 84802) | SQLITE_PRIVATE int sqlite3VdbeCheckMemInvariants(Mem *p){
  function vdbeMemRenderNum (line 84875) | static void vdbeMemRenderNum(int sz, char *zBuf, Mem *p){
  function SQLITE_PRIVATE (line 84923) | SQLITE_PRIVATE int sqlite3VdbeMemValidStrRep(Mem *p){
  function SQLITE_PRIVATE (line 84972) | SQLITE_PRIVATE int sqlite3VdbeChangeEncoding(Mem *pMem, int desiredEnc){
  function sqlite3VdbeMemGrow (line 85011) | int sqlite3VdbeMemGrow(Mem *pMem, int n, int bPreserve){
  function SQLITE_PRIVATE (line 85074) | SQLITE_PRIVATE int sqlite3VdbeMemClearAndResize(Mem *pMem, int szNew){
  function SQLITE_PRIVATE (line 85093) | SQLITE_PRIVATE void sqlite3VdbeMemZeroTerminateIfAble(Mem *pMem){
  function SQLITE_NOINLINE (line 85129) | static SQLITE_NOINLINE int vdbeMemAddTerminator(Mem *pMem){
  function SQLITE_PRIVATE (line 85146) | SQLITE_PRIVATE int sqlite3VdbeMemMakeWriteable(Mem *pMem){
  function SQLITE_PRIVATE (line 85170) | SQLITE_PRIVATE int sqlite3VdbeMemExpandBlob(Mem *pMem){
  function SQLITE_PRIVATE (line 85201) | SQLITE_PRIVATE int sqlite3VdbeMemNulTerminate(Mem *pMem){
  function SQLITE_PRIVATE (line 85227) | SQLITE_PRIVATE int sqlite3VdbeMemStringify(Mem *pMem, u8 enc, u8 bForce){
  function SQLITE_PRIVATE (line 85262) | SQLITE_PRIVATE int sqlite3VdbeMemFinalize(Mem *pMem, FuncDef *pFunc){
  function SQLITE_PRIVATE (line 85295) | SQLITE_PRIVATE int sqlite3VdbeMemAggValue(Mem *pAccum, Mem *pOut, FuncDe...
  function SQLITE_NOINLINE (line 85322) | static SQLITE_NOINLINE void vdbeMemClearExternAndSetNull(Mem *p){
  function SQLITE_NOINLINE (line 85345) | static SQLITE_NOINLINE void vdbeMemClear(Mem *p){
  function SQLITE_PRIVATE (line 85366) | SQLITE_PRIVATE void sqlite3VdbeMemRelease(Mem *p){
  function SQLITE_PRIVATE (line 85376) | SQLITE_PRIVATE void sqlite3VdbeMemReleaseMalloc(Mem *p){
  function SQLITE_NOINLINE (line 85392) | static SQLITE_NOINLINE i64 memIntValue(const Mem *pMem){
  function SQLITE_PRIVATE (line 85397) | SQLITE_PRIVATE i64 sqlite3VdbeIntValue(const Mem *pMem){
  function SQLITE_NOINLINE (line 85421) | static SQLITE_NOINLINE double memRealValue(Mem *pMem){
  function SQLITE_PRIVATE (line 85427) | SQLITE_PRIVATE double sqlite3VdbeRealValue(Mem *pMem){
  function SQLITE_PRIVATE (line 85448) | SQLITE_PRIVATE int sqlite3VdbeBooleanValue(Mem *pMem, int ifNull){
  function SQLITE_PRIVATE (line 85459) | SQLITE_PRIVATE void sqlite3VdbeIntegerAffinity(Mem *pMem){
  function SQLITE_PRIVATE (line 85491) | SQLITE_PRIVATE int sqlite3VdbeMemIntegerify(Mem *pMem){
  function SQLITE_PRIVATE (line 85506) | SQLITE_PRIVATE int sqlite3VdbeMemRealify(Mem *pMem){
  function SQLITE_PRIVATE (line 85525) | SQLITE_PRIVATE int sqlite3RealSameAsInt(double r1, sqlite3_int64 i){
  function SQLITE_PRIVATE (line 85536) | SQLITE_PRIVATE i64 sqlite3RealToI64(double r){
  function SQLITE_PRIVATE (line 85550) | SQLITE_PRIVATE int sqlite3VdbeMemNumerify(Mem *pMem){
  function SQLITE_PRIVATE (line 85583) | SQLITE_PRIVATE int sqlite3VdbeMemCast(Mem *pMem, u8 aff, u8 encoding){
  function SQLITE_PRIVATE (line 85630) | SQLITE_PRIVATE void sqlite3VdbeMemInit(Mem *pMem, sqlite3 *db, u16 flags){
  function SQLITE_PRIVATE (line 85650) | SQLITE_PRIVATE void sqlite3VdbeMemSetNull(Mem *pMem){
  function SQLITE_PRIVATE (line 85657) | SQLITE_PRIVATE void sqlite3ValueSetNull(sqlite3_value *p){
  function SQLITE_PRIVATE (line 85666) | SQLITE_PRIVATE void sqlite3VdbeMemSetZeroBlob(Mem *pMem, int n){
  function SQLITE_PRIVATE (line 85676) | SQLITE_PRIVATE int sqlite3VdbeMemSetZeroBlob(Mem *pMem, int n){
  function SQLITE_NOINLINE (line 85696) | static SQLITE_NOINLINE void vdbeReleaseAndSetInt64(Mem *pMem, i64 val){
  function SQLITE_PRIVATE (line 85706) | SQLITE_PRIVATE void sqlite3VdbeMemSetInt64(Mem *pMem, i64 val){
  function SQLITE_PRIVATE (line 85718) | SQLITE_PRIVATE void sqlite3MemSetArrayInt64(sqlite3_value *aMem, int iId...
  function SQLITE_PRIVATE (line 85723) | SQLITE_PRIVATE void sqlite3NoopDestructor(void *p){ UNUSED_PARAMETER(p); }
  function SQLITE_PRIVATE (line 85729) | SQLITE_PRIVATE void sqlite3VdbeMemSetPointer(
  function SQLITE_PRIVATE (line 85749) | SQLITE_PRIVATE void sqlite3VdbeMemSetDouble(Mem *pMem, double val){
  function SQLITE_PRIVATE (line 85763) | SQLITE_PRIVATE int sqlite3VdbeMemIsRowSet(const Mem *pMem){
  function SQLITE_PRIVATE (line 85776) | SQLITE_PRIVATE int sqlite3VdbeMemSetRowSet(Mem *pMem){
  function SQLITE_PRIVATE (line 85794) | SQLITE_PRIVATE int sqlite3VdbeMemTooBig(Mem *p){
  function SQLITE_PRIVATE (line 85815) | SQLITE_PRIVATE void sqlite3VdbeMemAboutToChange(Vdbe *pVdbe, Mem *pMem){
  function SQLITE_NOINLINE (line 85853) | static SQLITE_NOINLINE void vdbeClrCopy(Mem *pTo, const Mem *pFrom, int ...
  function SQLITE_PRIVATE (line 85858) | SQLITE_PRIVATE void sqlite3VdbeMemShallowCopy(Mem *pTo, const Mem *pFrom...
  function SQLITE_PRIVATE (line 85874) | SQLITE_PRIVATE int sqlite3VdbeMemCopy(Mem *pTo, const Mem *pFrom){
  function SQLITE_PRIVATE (line 85897) | SQLITE_PRIVATE void sqlite3VdbeMemMove(Mem *pTo, Mem *pFrom){
  function SQLITE_PRIVATE (line 85930) | SQLITE_PRIVATE int sqlite3VdbeMemSetStr(
  function SQLITE_PRIVATE (line 86041) | SQLITE_PRIVATE int sqlite3VdbeMemFromBtree(
  function SQLITE_PRIVATE (line 86069) | SQLITE_PRIVATE int sqlite3VdbeMemFromBtreeZeroOffset(
  function SQLITE_NOINLINE (line 86101) | static SQLITE_NOINLINE const void *valueToText(sqlite3_value* pVal, u8 e...
  function SQLITE_PRIVATE (line 86144) | SQLITE_PRIVATE const void *sqlite3ValueText(sqlite3_value* pVal, u8 enc){
  function SQLITE_PRIVATE (line 86165) | SQLITE_PRIVATE int sqlite3ValueIsOfClass(const sqlite3_value *pVal, void...
  function SQLITE_PRIVATE (line 86180) | SQLITE_PRIVATE sqlite3_value *sqlite3ValueNew(sqlite3 *db){
  type ValueNewStat4Ctx (line 86193) | struct ValueNewStat4Ctx {
  function sqlite3_value (line 86211) | static sqlite3_value *valueNew(sqlite3 *db, struct ValueNewStat4Ctx *p){
  function valueFromFunction (line 86274) | static int valueFromFunction(
  function valueFromExpr (line 86374) | static int valueFromExpr(
  function SQLITE_PRIVATE (line 86557) | SQLITE_PRIVATE int sqlite3ValueFromExpr(
  function stat4ValueFromExpr (line 86586) | static int stat4ValueFromExpr(
  function SQLITE_PRIVATE (line 86661) | SQLITE_PRIVATE int sqlite3Stat4ProbeSetValue(
  function SQLITE_PRIVATE (line 86706) | SQLITE_PRIVATE int sqlite3Stat4ValueFromExpr(
  function SQLITE_PRIVATE (line 86723) | SQLITE_PRIVATE int sqlite3Stat4Column(
  function SQLITE_PRIVATE (line 86768) | SQLITE_PRIVATE void sqlite3Stat4ProbeFree(UnpackedRecord *pRec){
  function SQLITE_PRIVATE (line 86786) | SQLITE_PRIVATE void sqlite3ValueSetStr(
  function SQLITE_PRIVATE (line 86799) | SQLITE_PRIVATE void sqlite3ValueFree(sqlite3_value *v){
  function SQLITE_NOINLINE (line 86810) | static SQLITE_NOINLINE int valueBytes(sqlite3_value *pVal, u8 enc){
  function SQLITE_PRIVATE (line 86813) | SQLITE_PRIVATE int sqlite3ValueBytes(sqlite3_value *pVal, u8 enc){
  function SQLITE_PRIVATE (line 86859) | SQLITE_PRIVATE Vdbe *sqlite3VdbeCreate(Parse *pParse){
  function SQLITE_PRIVATE (line 86886) | SQLITE_PRIVATE Parse *sqlite3VdbeParser(Vdbe *p){
  function SQLITE_PRIVATE (line 86893) | SQLITE_PRIVATE void sqlite3VdbeError(Vdbe *p, const char *zFormat, ...){
  function SQLITE_PRIVATE (line 86904) | SQLITE_PRIVATE void sqlite3VdbeSetSql(Vdbe *p, const char *z, int n, u8 ...
  function SQLITE_PRIVATE (line 86918) | SQLITE_PRIVATE void sqlite3VdbeAddDblquoteStr(sqlite3 *db, Vdbe *p, cons...
  function SQLITE_PRIVATE (line 86937) | SQLITE_PRIVATE int sqlite3VdbeUsesDoubleQuotedString(
  function SQLITE_PRIVATE (line 86961) | SQLITE_PRIVATE void sqlite3VdbeSwap(Vdbe *pA, Vdbe *pB){
  function growOpArray (line 86998) | static int growOpArray(Vdbe *v, int nOp){
  function test_addop_breakpoint (line 87047) | static void test_addop_breakpoint(int pc, Op *pOp){
  function SQLITE_NOINLINE (line 87061) | static SQLITE_NOINLINE int growOp3(Vdbe *p, int op, int p1, int p2, int ...
  function SQLITE_NOINLINE (line 87067) | static SQLITE_NOINLINE int addOp4IntSlow(
  function SQLITE_PRIVATE (line 87097) | SQLITE_PRIVATE int sqlite3VdbeAddOp0(Vdbe *p, int op){
  function SQLITE_PRIVATE (line 87100) | SQLITE_PRIVATE int sqlite3VdbeAddOp1(Vdbe *p, int op, int p1){
  function SQLITE_PRIVATE (line 87103) | SQLITE_PRIVATE int sqlite3VdbeAddOp2(Vdbe *p, int op, int p1, int p2){
  function SQLITE_PRIVATE (line 87106) | SQLITE_PRIVATE int sqlite3VdbeAddOp3(Vdbe *p, int op, int p1, int p2, in...
  function SQLITE_PRIVATE (line 87151) | SQLITE_PRIVATE int sqlite3VdbeAddOp4Int(
  function SQLITE_PRIVATE (line 87203) | SQLITE_PRIVATE int sqlite3VdbeGoto(Vdbe *p, int iDest){
  function SQLITE_PRIVATE (line 87210) | SQLITE_PRIVATE int sqlite3VdbeLoadString(Vdbe *p, int iDest, const char ...
  function SQLITE_PRIVATE (line 87225) | SQLITE_PRIVATE void sqlite3VdbeMultiLoad(Vdbe *p, int iDest, const char ...
  function SQLITE_PRIVATE (line 87248) | SQLITE_PRIVATE int sqlite3VdbeAddOp4(
  function SQLITE_PRIVATE (line 87272) | SQLITE_PRIVATE int sqlite3VdbeAddFunctionCall(
  function SQLITE_PRIVATE (line 87308) | SQLITE_PRIVATE int sqlite3VdbeAddOp4Dup8(
  function SQLITE_PRIVATE (line 87327) | SQLITE_PRIVATE int sqlite3VdbeExplainParent(Parse *pParse){
  function SQLITE_PRIVATE (line 87339) | SQLITE_PRIVATE void sqlite3ExplainBreakpoint(const char *z1, const char ...
  function SQLITE_PRIVATE (line 87351) | SQLITE_PRIVATE int sqlite3VdbeExplain(Parse *pParse, u8 bPush, const cha...
  function SQLITE_PRIVATE (line 87382) | SQLITE_PRIVATE void sqlite3VdbeExplainPop(Parse *pParse){
  function SQLITE_PRIVATE (line 87396) | SQLITE_PRIVATE void sqlite3VdbeAddParseSchemaOp(Vdbe *p, int iDb, char *...
  function SQLITE_PRIVATE (line 87406) | SQLITE_PRIVATE void sqlite3VdbeEndCoroutine(Vdbe *v, int regYield){
  function SQLITE_PRIVATE (line 87444) | SQLITE_PRIVATE int sqlite3VdbeMakeLabel(Parse *pParse){
  function SQLITE_NOINLINE (line 87453) | static SQLITE_NOINLINE void resizeResolveLabel(Parse *p, Vdbe *v, int j){
  function SQLITE_PRIVATE (line 87471) | SQLITE_PRIVATE void sqlite3VdbeResolveLabel(Vdbe *v, int x){
  function SQLITE_PRIVATE (line 87493) | SQLITE_PRIVATE void sqlite3VdbeRunOnlyOnce(Vdbe *p){
  function SQLITE_PRIVATE (line 87500) | SQLITE_PRIVATE void sqlite3VdbeReusable(Vdbe *p){
  type VdbeOpIter (line 87528) | typedef struct VdbeOpIter VdbeOpIter;
  type VdbeOpIter (line 87529) | struct VdbeOpIter {
  function Op (line 87536) | static Op *opIterNext(VdbeOpIter *p){
  function SQLITE_PRIVATE (line 87603) | SQLITE_PRIVATE int sqlite3VdbeAssertMayAbort(Vdbe *v, int mayAbort){
  function SQLITE_PRIVATE (line 87663) | SQLITE_PRIVATE void sqlite3VdbeIncrWriteCounter(Vdbe *p, VdbeCursor *pC){
  function SQLITE_PRIVATE (line 87679) | SQLITE_PRIVATE void sqlite3VdbeAssertAbortable(Vdbe *p){
  function resolveP2Values (line 87705) | static void resolveP2Values(Vdbe *p, int *pMaxVtabArgs){
  function SQLITE_PRIVATE (line 87829) | SQLITE_PRIVATE void sqlite3VdbeNoJumpsOutsideSubrtn(
  function SQLITE_PRIVATE (line 87899) | SQLITE_PRIVATE int sqlite3VdbeCurrentAddr(Vdbe *p){
  function SQLITE_PRIVATE (line 87913) | SQLITE_PRIVATE void sqlite3VdbeVerifyNoMallocRequired(Vdbe *p, int N){
  function SQLITE_PRIVATE (line 87926) | SQLITE_PRIVATE void sqlite3VdbeVerifyNoResultRow(Vdbe *p){
  function SQLITE_PRIVATE (line 87940) | SQLITE_PRIVATE void sqlite3VdbeVerifyAbortable(Vdbe *p, int onError){
  function SQLITE_PRIVATE (line 87956) | SQLITE_PRIVATE VdbeOp *sqlite3VdbeTakeOpArray(Vdbe *p, int *pnOp, int *p...
  function SQLITE_PRIVATE (line 87976) | SQLITE_PRIVATE VdbeOp *sqlite3VdbeAddOpList(
  function SQLITE_PRIVATE (line 88024) | SQLITE_PRIVATE void sqlite3VdbeScanStatus(
  function SQLITE_PRIVATE (line 88056) | SQLITE_PRIVATE void sqlite3VdbeScanStatusRange(
  function SQLITE_PRIVATE (line 88088) | SQLITE_PRIVATE void sqlite3VdbeScanStatusCounters(
  function SQLITE_PRIVATE (line 88115) | SQLITE_PRIVATE void sqlite3VdbeChangeOpcode(Vdbe *p, int addr, u8 iNewOp...
  function SQLITE_PRIVATE (line 88119) | SQLITE_PRIVATE void sqlite3VdbeChangeP1(Vdbe *p, int addr, int val){
  function SQLITE_PRIVATE (line 88123) | SQLITE_PRIVATE void sqlite3VdbeChangeP2(Vdbe *p, int addr, int val){
  function SQLITE_PRIVATE (line 88127) | SQLITE_PRIVATE void sqlite3VdbeChangeP3(Vdbe *p, int addr, int val){
  function SQLITE_PRIVATE (line 88131) | SQLITE_PRIVATE void sqlite3VdbeChangeP5(Vdbe *p, u16 p5){
  function SQLITE_PRIVATE (line 88141) | SQLITE_PRIVATE void sqlite3VdbeTypeofColumn(Vdbe *p, int iDest){
  function SQLITE_PRIVATE (line 88155) | SQLITE_PRIVATE void sqlite3VdbeJumpHere(Vdbe *p, int addr){
  function SQLITE_PRIVATE (line 88172) | SQLITE_PRIVATE void sqlite3VdbeJumpHereOrPopInst(Vdbe *p, int addr){
  function freeEphemeralFunction (line 88192) | static void freeEphemeralFunction(sqlite3 *db, FuncDef *pDef){
  function SQLITE_NOINLINE (line 88202) | static SQLITE_NOINLINE void freeP4Mem(sqlite3 *db, Mem *p){
  function SQLITE_NOINLINE (line 88206) | static SQLITE_NOINLINE void freeP4FuncCtx(sqlite3 *db, sqlite3_context *p){
  function freeP4 (line 88211) | static void freeP4(sqlite3 *db, int p4type, void *p4){
  function vdbeFreeOpArray (line 88269) | static void vdbeFreeOpArray(sqlite3 *db, Op *aOp, int nOp){
  function SQLITE_PRIVATE (line 88291) | SQLITE_PRIVATE void sqlite3VdbeLinkSubProgram(Vdbe *pVdbe, SubProgram *p){
  function SQLITE_PRIVATE (line 88299) | SQLITE_PRIVATE int sqlite3VdbeHasSubProgram(Vdbe *pVdbe){
  function SQLITE_PRIVATE (line 88306) | SQLITE_PRIVATE int sqlite3VdbeChangeToNoop(Vdbe *p, int addr){
  function SQLITE_PRIVATE (line 88322) | SQLITE_PRIVATE int sqlite3VdbeDeletePriorOpcode(Vdbe *p, u8 op){
  function SQLITE_PRIVATE (line 88335) | SQLITE_PRIVATE void sqlite3VdbeReleaseRegisters(
  function vdbeChangeP4Full (line 88381) | static void SQLITE_NOINLINE vdbeChangeP4Full(
  function SQLITE_PRIVATE (line 88400) | SQLITE_PRIVATE void sqlite3VdbeChangeP4(Vdbe *p, int addr, const char *z...
  function SQLITE_PRIVATE (line 88443) | SQLITE_PRIVATE void sqlite3VdbeAppendP4(Vdbe *p, void *pP4, int n){
  function SQLITE_PRIVATE (line 88463) | SQLITE_PRIVATE void sqlite3VdbeSetP4KeyInfo(Parse *pParse, Index *pIdx){
  function vdbeVComment (line 88479) | static void vdbeVComment(Vdbe *p, const char *zFormat, va_list ap){
  function SQLITE_PRIVATE (line 88488) | SQLITE_PRIVATE void sqlite3VdbeComment(Vdbe *p, const char *zFormat, ...){
  function SQLITE_PRIVATE (line 88496) | SQLITE_PRIVATE void sqlite3VdbeNoopComment(Vdbe *p, const char *zFormat,...
  function SQLITE_PRIVATE (line 88511) | SQLITE_PRIVATE void sqlite3VdbeSetLineNumber(Vdbe *v, int iLine){
  function SQLITE_PRIVATE (line 88529) | SQLITE_PRIVATE VdbeOp *sqlite3VdbeGetOp(Vdbe *p, int addr){
  function SQLITE_PRIVATE (line 88544) | SQLITE_PRIVATE VdbeOp *sqlite3VdbeGetLastOp(Vdbe *p){
  function translateP (line 88553) | static int translateP(char c, const Op *pOp){
  function SQLITE_PRIVATE (line 88574) | SQLITE_PRIVATE char *sqlite3VdbeDisplayComment(
  function displayP4Expr (line 88664) | static void displayP4Expr(StrAccum *p, Expr *pExpr){
  function SQLITE_PRIVATE (line 88739) | SQLITE_PRIVATE char *sqlite3VdbeDisplayP4(sqlite3 *db, Op *pOp){
  function SQLITE_PRIVATE (line 88865) | SQLITE_PRIVATE void sqlite3VdbeUsesBtree(Vdbe *p, int i){
  function SQLITE_PRIVATE (line 88896) | SQLITE_PRIVATE void sqlite3VdbeEnter(Vdbe *p){
  function SQLITE_NOINLINE (line 88917) | static SQLITE_NOINLINE void vdbeLeave(Vdbe *p){
  function SQLITE_PRIVATE (line 88931) | SQLITE_PRIVATE void sqlite3VdbeLeave(Vdbe *p){
  function SQLITE_PRIVATE (line 88941) | SQLITE_PRIVATE void sqlite3VdbePrintOp(FILE *pOut, int pc, VdbeOp *pOp){
  function initMemArray (line 88985) | static void initMemArray(Mem *p, int N, sqlite3 *db, u16 flags){
  function releaseMemArray (line 89009) | static void releaseMemArray(Mem *p, int N){
  function SQLITE_PRIVATE (line 89063) | SQLITE_PRIVATE int sqlite3VdbeFrameIsValid(VdbeFrame *pFrame){
  function SQLITE_PRIVATE (line 89077) | SQLITE_PRIVATE void sqlite3VdbeFrameMemDel(void *pArg){
  function SQLITE_PRIVATE (line 89092) | SQLITE_PRIVATE int sqlite3VdbeNextOpcode(
  function SQLITE_PRIVATE (line 89204) | SQLITE_PRIVATE void sqlite3VdbeFrameDelete(VdbeFrame *p){
  function SQLITE_PRIVATE (line 89236) | SQLITE_PRIVATE int sqlite3VdbeList(
  function SQLITE_PRIVATE (line 89331) | SQLITE_PRIVATE void sqlite3VdbePrintSql(Vdbe *p){
  function SQLITE_PRIVATE (line 89350) | SQLITE_PRIVATE void sqlite3VdbeIOTraceSql(Vdbe *p){
  type ReusableSpace (line 89380) | struct ReusableSpace {
  type ReusableSpace (line 89401) | struct ReusableSpace
  function SQLITE_PRIVATE (line 89423) | SQLITE_PRIVATE void sqlite3VdbeRewind(Vdbe *p){
  function SQLITE_PRIVATE (line 89477) | SQLITE_PRIVATE void sqlite3VdbeMakeReady(
  function SQLITE_PRIVATE (line 89580) | SQLITE_PRIVATE void sqlite3VdbeFreeCursor(Vdbe *p, VdbeCursor *pCx){
  function SQLITE_NOINLINE (line 89583) | static SQLITE_NOINLINE void freeCursorWithCache(Vdbe *p, VdbeCursor *pCx){
  function SQLITE_PRIVATE (line 89595) | SQLITE_PRIVATE void sqlite3VdbeFreeCursorNN(Vdbe *p, VdbeCursor *pCx){
  function closeCursorsInFrame (line 89626) | static void closeCursorsInFrame(Vdbe *p){
  function SQLITE_PRIVATE (line 89642) | SQLITE_PRIVATE int sqlite3VdbeFrameRestore(VdbeFrame *pFrame){
  function closeAllCursors (line 89668) | static void closeAllCursors(Vdbe *p){
  function SQLITE_PRIVATE (line 89696) | SQLITE_PRIVATE void sqlite3VdbeSetNumCols(Vdbe *p, int nResColumn){
  function SQLITE_PRIVATE (line 89721) | SQLITE_PRIVATE int sqlite3VdbeSetColName(
  function vdbeCommit (line 89749) | static int vdbeCommit(sqlite3 *db, Vdbe *p){
  function checkActiveVdbeCnt (line 90017) | static void checkActiveVdbeCnt(sqlite3 *db){
  function SQLITE_NOINLINE (line 90049) | static SQLITE_NOINLINE int vdbeCloseStatement(Vdbe *p, int eOp){
  function SQLITE_PRIVATE (line 90095) | SQLITE_PRIVATE int sqlite3VdbeCloseStatement(Vdbe *p, int eOp){
  function SQLITE_NOINLINE (line 90114) | static SQLITE_NOINLINE int vdbeFkError(Vdbe *p){
  function SQLITE_PRIVATE (line 90121) | SQLITE_PRIVATE int sqlite3VdbeCheckFkImmediate(Vdbe *p){
  function SQLITE_PRIVATE (line 90125) | SQLITE_PRIVATE int sqlite3VdbeCheckFkDeferred(Vdbe *p){
  function SQLITE_PRIVATE (line 90145) | SQLITE_PRIVATE int sqlite3VdbeHalt(Vdbe *p){
  function SQLITE_PRIVATE (line 90354) | SQLITE_PRIVATE void sqlite3VdbeResetStepResult(Vdbe *p){
  function SQLITE_PRIVATE (line 90366) | SQLITE_PRIVATE int sqlite3VdbeTransferError(Vdbe *p){
  function vdbeInvokeSqllog (line 90389) | static void vdbeInvokeSqllog(Vdbe *v){
  function SQLITE_PRIVATE (line 90416) | SQLITE_PRIVATE int sqlite3VdbeReset(Vdbe *p){
  function SQLITE_PRIVATE (line 90507) | SQLITE_PRIVATE int sqlite3VdbeFinalize(Vdbe *p){
  function SQLITE_PRIVATE (line 90536) | SQLITE_PRIVATE void sqlite3VdbeDeleteAuxData(sqlite3 *db, AuxData **pp, ...
  function sqlite3VdbeClearObject (line 90564) | static void sqlite3VdbeClearObject(sqlite3 *db, Vdbe *p){
  function SQLITE_PRIVATE (line 90608) | SQLITE_PRIVATE void sqlite3VdbeDelete(Vdbe *p){
  function SQLITE_NOINLINE (line 90631) | SQLITE_NOINLINE sqlite3VdbeFinishMoveto(VdbeCursor *p){
  function SQLITE_NOINLINE (line 90657) | SQLITE_NOINLINE sqlite3VdbeHandleMovedCursor(VdbeCursor *p){
  function SQLITE_PRIVATE (line 90672) | SQLITE_PRIVATE int sqlite3VdbeCursorRestore(VdbeCursor *p){
  function SQLITE_PRIVATE (line 90734) | SQLITE_PRIVATE u32 sqlite3VdbeSerialType(Mem *pMem, int file_format, u32...
  function SQLITE_PRIVATE (line 90818) | SQLITE_PRIVATE u32 sqlite3VdbeSerialTypeLen(u32 serial_type){
  function SQLITE_PRIVATE (line 90827) | SQLITE_PRIVATE u8 sqlite3VdbeOneByteSerialTypeLen(u8 serial_type){
  function SQLITE_PRIVATE (line 90867) | SQLITE_PRIVATE u64 sqlite3FloatSwap(u64 in){
  function serialGet (line 90901) | static void serialGet(
  function serialGet7 (line 90936) | static int serialGet7(
  function SQLITE_PRIVATE (line 90953) | SQLITE_PRIVATE void sqlite3VdbeSerialGet(
  function SQLITE_PRIVATE (line 91052) | SQLITE_PRIVATE UnpackedRecord *sqlite3VdbeAllocUnpackedRecord(
  function SQLITE_PRIVATE (line 91072) | SQLITE_PRIVATE void sqlite3VdbeRecordUnpack(
  function vdbeRecordCompareDebug (line 91129) | static int vdbeRecordCompareDebug(
  function vdbeAssertFieldCountWithinLimits (line 91250) | static void vdbeAssertFieldCountWithinLimits(
  function SQLITE_NOINLINE (line 91280) | static SQLITE_NOINLINE int vdbeCompareMemStringWithEncodingChange(
  function vdbeCompareMemString (line 91306) | static int vdbeCompareMemString(
  function isAllZero (line 91325) | static int isAllZero(const char *z, int n){
  function sqlite3BlobCompare (line 91338) | int sqlite3BlobCompare(const Mem *pB1, const Mem *pB2){
  function doubleLt (line 91372) | static int SQLITE_NOINLINE doubleLt(double a, double b){ return a<b; }
  function doubleEq (line 91373) | static int SQLITE_NOINLINE doubleEq(double a, double b){ return a==b; }
  function SQLITE_PRIVATE (line 91381) | SQLITE_PRIVATE int sqlite3IntFloatCompare(i64 i, double r){
  function SQLITE_PRIVATE (line 91409) | SQLITE_PRIVATE int sqlite3MemCompare(const Mem *pMem1, const Mem *pMem2,...
  function i64 (line 91508) | static i64 vdbeRecordDecodeInt(u32 serial_type, const u8 *aKey){
  function SQLITE_PRIVATE (line 91563) | SQLITE_PRIVATE int sqlite3VdbeRecordCompareWithSkip(
  function SQLITE_PRIVATE (line 91784) | SQLITE_PRIVATE int sqlite3VdbeRecordCompare(
  function vdbeRecordCompareInt (line 91801) | static int vdbeRecordCompareInt(
  function vdbeRecordCompareString (line 91896) | static int vdbeRecordCompareString(
  function SQLITE_PRIVATE (line 91966) | SQLITE_PRIVATE RecordCompare sqlite3VdbeFindCompare(UnpackedRecord *p){
  function SQLITE_PRIVATE (line 92021) | SQLITE_PRIVATE int sqlite3VdbeIdxRowid(sqlite3 *db, BtCursor *pCur, i64 ...
  function SQLITE_PRIVATE (line 92100) | SQLITE_PRIVATE int sqlite3VdbeIdxKeyCompare(
  function SQLITE_PRIVATE (line 92135) | SQLITE_PRIVATE void sqlite3VdbeSetChanges(sqlite3 *db, i64 nChange){
  function SQLITE_PRIVATE (line 92145) | SQLITE_PRIVATE void sqlite3VdbeCountChanges(Vdbe *v){
  function SQLITE_PRIVATE (line 92167) | SQLITE_PRIVATE void sqlite3ExpirePreparedStatements(sqlite3 *db, int iCo...
  function SQLITE_PRIVATE (line 92177) | SQLITE_PRIVATE sqlite3 *sqlite3VdbeDb(Vdbe *v){
  function SQLITE_PRIVATE (line 92184) | SQLITE_PRIVATE u8 sqlite3VdbePrepareFlags(Vdbe *v){
  function SQLITE_PRIVATE (line 92196) | SQLITE_PRIVATE sqlite3_value *sqlite3VdbeGetBoundValue(Vdbe *v, int iVar...
  function SQLITE_PRIVATE (line 92219) | SQLITE_PRIVATE void sqlite3VdbeSetVarmask(Vdbe *v, int iVar){
  function SQLITE_PRIVATE (line 92240) | SQLITE_PRIVATE int sqlite3NotPureFunc(sqlite3_context *pCtx){
  function SQLITE_PRIVATE (line 92272) | SQLITE_PRIVATE int sqlite3CursorRangeHintExprCheck(Walker *pWalker, Expr...
  function SQLITE_PRIVATE (line 92286) | SQLITE_PRIVATE void sqlite3VtabImportErrmsg(Vdbe *p, sqlite3_vtab *pVtab){
  function vdbeFreeUnpacked (line 92307) | static void vdbeFreeUnpacked(sqlite3 *db, int nField, UnpackedRecord *p){
  function SQLITE_PRIVATE (line 92327) | SQLITE_PRIVATE void sqlite3VdbePreUpdateHook(
  function SQLITE_PRIVATE (line 92413) | SQLITE_PRIVATE const char *sqlite3VdbeFuncName(const sqlite3_context *pC...
  function SQLITE_API (line 92450) | SQLITE_API int sqlite3_expired(sqlite3_stmt *pStmt){
  function vdbeSafety (line 92461) | static int vdbeSafety(Vdbe *p){
  function vdbeSafetyNotNull (line 92469) | static int vdbeSafetyNotNull(Vdbe *p){
  function SQLITE_NOINLINE (line 92483) | static SQLITE_NOINLINE void invokeProfileCallback(sqlite3 *db, Vdbe *p){
  function SQLITE_API (line 92520) | SQLITE_API int sqlite3_finalize(sqlite3_stmt *pStmt){
  function SQLITE_API (line 92549) | SQLITE_API int sqlite3_reset(sqlite3_stmt *pStmt){
  function SQLITE_API (line 92570) | SQLITE_API int sqlite3_clear_bindings(sqlite3_stmt *pStmt){
  function SQLITE_API (line 92603) | SQLITE_API const void *sqlite3_value_blob(sqlite3_value *pVal){
  function SQLITE_API (line 92616) | SQLITE_API int sqlite3_value_bytes(sqlite3_value *pVal){
  function SQLITE_API (line 92619) | SQLITE_API int sqlite3_value_bytes16(sqlite3_value *pVal){
  function SQLITE_API (line 92622) | SQLITE_API double sqlite3_value_double(sqlite3_value *pVal){
  function SQLITE_API (line 92625) | SQLITE_API int sqlite3_value_int(sqlite3_value *pVal){
  function SQLITE_API (line 92628) | SQLITE_API sqlite_int64 sqlite3_value_int64(sqlite3_value *pVal){
  function sqlite3_value_subtype (line 92631) | SQLITE_API unsigned int sqlite3_value_subtype(sqlite3_value *pVal){
  function SQLITE_API (line 92635) | SQLITE_API void *sqlite3_value_pointer(sqlite3_value *pVal, const char *...
  function SQLITE_API (line 92652) | SQLITE_API const void *sqlite3_value_text16(sqlite3_value* pVal){
  function SQLITE_API (line 92655) | SQLITE_API const void *sqlite3_value_text16be(sqlite3_value *pVal){
  function SQLITE_API (line 92658) | SQLITE_API const void *sqlite3_value_text16le(sqlite3_value *pVal){
  function SQLITE_API (line 92666) | SQLITE_API int sqlite3_value_type(sqlite3_value* pVal){
  function SQLITE_API (line 92750) | SQLITE_API int sqlite3_value_encoding(sqlite3_value *pVal){
  function SQLITE_API (line 92755) | SQLITE_API int sqlite3_value_nochange(sqlite3_value *pVal){
  function SQLITE_API (line 92760) | SQLITE_API int sqlite3_value_frombind(sqlite3_value *pVal){
  function SQLITE_API (line 92766) | SQLITE_API sqlite3_value *sqlite3_value_dup(const sqlite3_value *pOrig){
  function SQLITE_API (line 92792) | SQLITE_API void sqlite3_value_free(sqlite3_value *pOld){
  function setResultStrOrError (line 92808) | static void setResultStrOrError(
  function invokeValueDestructor (line 92833) | static int invokeValueDestructor(
  function SQLITE_API (line 92856) | SQLITE_API void sqlite3_result_blob(
  function SQLITE_API (line 92872) | SQLITE_API void sqlite3_result_blob64(
  function SQLITE_API (line 92892) | SQLITE_API void sqlite3_result_double(sqlite3_context *pCtx, double rVal){
  function SQLITE_API (line 92899) | SQLITE_API void sqlite3_result_error(sqlite3_context *pCtx, const char *...
  function SQLITE_API (line 92908) | SQLITE_API void sqlite3_result_error16(sqlite3_context *pCtx, const void...
  function SQLITE_API (line 92917) | SQLITE_API void sqlite3_result_int(sqlite3_context *pCtx, int iVal){
  function SQLITE_API (line 92924) | SQLITE_API void sqlite3_result_int64(sqlite3_context *pCtx, i64 iVal){
  function SQLITE_API (line 92931) | SQLITE_API void sqlite3_result_null(sqlite3_context *pCtx){
  function SQLITE_API (line 92938) | SQLITE_API void sqlite3_result_pointer(
  function SQLITE_API (line 92957) | SQLITE_API void sqlite3_result_subtype(sqlite3_context *pCtx, unsigned i...
  function SQLITE_API (line 92979) | SQLITE_API void sqlite3_result_text(
  function SQLITE_API (line 92994) | SQLITE_API void sqlite3_result_text64(
  function SQLITE_API (line 93021) | SQLITE_API void sqlite3_result_text16(
  function SQLITE_API (line 93030) | SQLITE_API void sqlite3_result_text16be(
  function SQLITE_API (line 93039) | SQLITE_API void sqlite3_result_text16le(
  function SQLITE_API (line 93049) | SQLITE_API void sqlite3_result_value(sqlite3_context *pCtx, sqlite3_valu...
  function SQLITE_API (line 93067) | SQLITE_API void sqlite3_result_zeroblob(sqlite3_context *pCtx, int n){
  function SQLITE_API (line 93070) | SQLITE_API int sqlite3_result_zeroblob64(sqlite3_context *pCtx, u64 n){
  function SQLITE_API (line 93089) | SQLITE_API void sqlite3_result_error_code(sqlite3_context *pCtx, int err...
  function SQLITE_API (line 93104) | SQLITE_API void sqlite3_result_error_toobig(sqlite3_context *pCtx){
  function SQLITE_API (line 93115) | SQLITE_API void sqlite3_result_error_nomem(sqlite3_context *pCtx){
  function SQLITE_PRIVATE (line 93130) | SQLITE_PRIVATE void sqlite3ResultIntReal(sqlite3_context *pCtx){
  function doWalCallbacks (line 93144) | static int doWalCallbacks(sqlite3 *db){
  function sqlite3Step (line 93174) | static int sqlite3Step(Vdbe *p){
  function SQLITE_API (line 93316) | SQLITE_API int sqlite3_step(sqlite3_stmt *pStmt){
  function SQLITE_API (line 93370) | SQLITE_API void *sqlite3_user_data(sqlite3_context *p){
  function SQLITE_API (line 93388) | SQLITE_API sqlite3 *sqlite3_context_db_handle(sqlite3_context *p){
  function SQLITE_API (line 93411) | SQLITE_API int sqlite3_vtab_nochange(sqlite3_context *p){
  function SQLITE_PRIVATE (line 93427) | SQLITE_PRIVATE void sqlite3VdbeValueListFree(void *pToDelete){
  function valueFromValueList (line 93435) | static int valueFromValueList(
  function SQLITE_API (line 93490) | SQLITE_API int sqlite3_vtab_in_first(sqlite3_value *pVal, sqlite3_value ...
  function SQLITE_API (line 93498) | SQLITE_API int sqlite3_vtab_in_next(sqlite3_value *pVal, sqlite3_value *...
  function SQLITE_PRIVATE (line 93509) | SQLITE_PRIVATE sqlite3_int64 sqlite3StmtCurrentTime(sqlite3_context *p){
  function SQLITE_NOINLINE (line 93529) | static SQLITE_NOINLINE void *createAggContext(sqlite3_context *p, int nB...
  function SQLITE_API (line 93551) | SQLITE_API void *sqlite3_aggregate_context(sqlite3_context *p, int nByte){
  function SQLITE_API (line 93572) | SQLITE_API void *sqlite3_get_auxdata(sqlite3_context *pCtx, int iArg){
  function SQLITE_API (line 93603) | SQLITE_API void sqlite3_set_auxdata(
  function SQLITE_API (line 93660) | SQLITE_API int sqlite3_aggregate_count(sqlite3_context *p){
  function SQLITE_API (line 93669) | SQLITE_API int sqlite3_column_count(sqlite3_stmt *pStmt){
  function SQLITE_API (line 93679) | SQLITE_API int sqlite3_data_count(sqlite3_stmt *pStmt){
  function Mem (line 93729) | static Mem *columnMem(sqlite3_stmt *pStmt, int i){
  function columnMallocFailure (line 93764) | static void columnMallocFailure(sqlite3_stmt *pStmt)
  function SQLITE_API (line 93784) | SQLITE_API const void *sqlite3_column_blob(sqlite3_stmt *pStmt, int i){
  function SQLITE_API (line 93794) | SQLITE_API int sqlite3_column_bytes(sqlite3_stmt *pStmt, int i){
  function SQLITE_API (line 93799) | SQLITE_API int sqlite3_column_bytes16(sqlite3_stmt *pStmt, int i){
  function SQLITE_API (line 93804) | SQLITE_API double sqlite3_column_double(sqlite3_stmt *pStmt, int i){
  function SQLITE_API (line 93809) | SQLITE_API int sqlite3_column_int(sqlite3_stmt *pStmt, int i){
  function SQLITE_API (line 93814) | SQLITE_API sqlite_int64 sqlite3_column_int64(sqlite3_stmt *pStmt, int i){
  function SQLITE_API (line 93824) | SQLITE_API sqlite3_value *sqlite3_column_value(sqlite3_stmt *pStmt, int i){
  function SQLITE_API (line 93834) | SQLITE_API const void *sqlite3_column_text16(sqlite3_stmt *pStmt, int i){
  function SQLITE_API (line 93840) | SQLITE_API int sqlite3_column_type(sqlite3_stmt *pStmt, int i){
  function SQLITE_API (line 93953) | SQLITE_API const char *sqlite3_column_name(sqlite3_stmt *pStmt, int N){
  function SQLITE_API (line 93957) | SQLITE_API const void *sqlite3_column_name16(sqlite3_stmt *pStmt, int N){
  function SQLITE_API (line 93976) | SQLITE_API const char *sqlite3_column_decltype(sqlite3_stmt *pStmt, int N){
  function SQLITE_API (line 93980) | SQLITE_API const void *sqlite3_column_decltype16(sqlite3_stmt *pStmt, in...
  function SQLITE_API (line 93992) | SQLITE_API const char *sqlite3_column_database_name(sqlite3_stmt *pStmt,...
  function SQLITE_API (line 93996) | SQLITE_API const void *sqlite3_column_database_name16(sqlite3_stmt *pStm...
  function SQLITE_API (line 94006) | SQLITE_API const char *sqlite3_column_table_name(sqlite3_stmt *pStmt, in...
  function SQLITE_API (line 94010) | SQLITE_API const void *sqlite3_column_table_name16(sqlite3_stmt *pStmt, ...
  function SQLITE_API (line 94020) | SQLITE_API const char *sqlite3_column_origin_name(sqlite3_stmt *pStmt, i...
  function SQLITE_API (line 94024) | SQLITE_API const void *sqlite3_column_origin_name16(sqlite3_stmt *pStmt,...
  function vdbeUnbind (line 94057) | static int vdbeUnbind(Vdbe *p, unsigned int i){
  function bindText (line 94099) | static int bindText(
  function SQLITE_API (line 94140) | SQLITE_API int sqlite3_bind_blob(
  function SQLITE_API (line 94152) | SQLITE_API int sqlite3_bind_blob64(
  function SQLITE_API (line 94162) | SQLITE_API int sqlite3_bind_double(sqlite3_stmt *pStmt, int i, double rV...
  function SQLITE_API (line 94173) | SQLITE_API int sqlite3_bind_int(sqlite3_stmt *p, int i, int iValue){
  function SQLITE_API (line 94176) | SQLITE_API int sqlite3_bind_int64(sqlite3_stmt *pStmt, int i, sqlite_int...
  function SQLITE_API (line 94187) | SQLITE_API int sqlite3_bind_null(sqlite3_stmt *pStmt, int i){
  function SQLITE_API (line 94197) | SQLITE_API int sqlite3_bind_pointer(
  function SQLITE_API (line 94216) | SQLITE_API int sqlite3_bind_text(
  function SQLITE_API (line 94225) | SQLITE_API int sqlite3_bind_text64(
  function SQLITE_API (line 94241) | SQLITE_API int sqlite3_bind_text16(
  function SQLITE_API (line 94251) | SQLITE_API int sqlite3_bind_value(sqlite3_stmt *pStmt, int i, const sqli...
  function SQLITE_API (line 94285) | SQLITE_API int sqlite3_bind_zeroblob(sqlite3_stmt *pStmt, int i, int n){
  function SQLITE_API (line 94300) | SQLITE_API int sqlite3_bind_zeroblob64(sqlite3_stmt *pStmt, int i, sqlit...
  function SQLITE_API (line 94322) | SQLITE_API int sqlite3_bind_parameter_count(sqlite3_stmt *pStmt){
  function SQLITE_API (line 94333) | SQLITE_API const char *sqlite3_bind_parameter_name(sqlite3_stmt *pStmt, ...
  function SQLITE_PRIVATE (line 94344) | SQLITE_PRIVATE int sqlite3VdbeParameterIndex(Vdbe *p, const char *zName,...
  function SQLITE_API (line 94348) | SQLITE_API int sqlite3_bind_parameter_index(sqlite3_stmt *pStmt, const c...
  function SQLITE_PRIVATE (line 94355) | SQLITE_PRIVATE int sqlite3TransferBindings(sqlite3_stmt *pFromStmt, sqli...
  function SQLITE_API (line 94382) | SQLITE_API int sqlite3_transfer_bindings(sqlite3_stmt *pFromStmt, sqlite...
  function SQLITE_API (line 94406) | SQLITE_API sqlite3 *sqlite3_db_handle(sqlite3_stmt *pStmt){
  function SQLITE_API (line 94414) | SQLITE_API int sqlite3_stmt_readonly(sqlite3_stmt *pStmt){
  function SQLITE_API (line 94422) | SQLITE_API int sqlite3_stmt_isexplain(sqlite3_stmt *pStmt){
  function SQLITE_API (line 94429) | SQLITE_API int sqlite3_stmt_explain(sqlite3_stmt *pStmt, int eMode){
  function SQLITE_API (line 94465) | SQLITE_API int sqlite3_stmt_busy(sqlite3_stmt *pStmt){
  function SQLITE_API (line 94476) | SQLITE_API sqlite3_stmt *sqlite3_next_stmt(sqlite3 *pDb, sqlite3_stmt *p...
  function SQLITE_API (line 94497) | SQLITE_API int sqlite3_stmt_status(sqlite3_stmt *pStmt, int op, int rese...
  function SQLITE_API (line 94529) | SQLITE_API const char *sqlite3_sql(sqlite3_stmt *pStmt){
  function SQLITE_API (line 94543) | SQLITE_API char *sqlite3_expanded_sql(sqlite3_stmt *pStmt){
  function SQLITE_API (line 94563) | SQLITE_API const char *sqlite3_normalized_sql(sqlite3_stmt *pStmt){
  function UnpackedRecord (line 94581) | static UnpackedRecord *vdbeUnpackRecord(
  function SQLITE_API (line 94600) | SQLITE_API int sqlite3_preupdate_old(sqlite3 *db, int iIdx, sqlite3_valu...
  function SQLITE_API (line 94705) | SQLITE_API int sqlite3_preupdate_count(sqlite3 *db){
  function SQLITE_API (line 94728) | SQLITE_API int sqlite3_preupdate_depth(sqlite3 *db){
  function SQLITE_API (line 94744) | SQLITE_API int sqlite3_preupdate_blobwrite(sqlite3 *db){
  function SQLITE_API (line 94760) | SQLITE_API int sqlite3_preupdate_new(sqlite3 *db, int iIdx, sqlite3_valu...
  function SQLITE_API (line 94848) | SQLITE_API int sqlite3_stmt_scanstatus_v2(
  function SQLITE_API (line 95002) | SQLITE_API int sqlite3_stmt_scanstatus(
  function SQLITE_API (line 95014) | SQLITE_API void sqlite3_stmt_scanstatus_reset(sqlite3_stmt *pStmt){
  function i64 (line 95055) | static i64 findNextHostParameter(const char *zSql, i64 *pnToken){
  function SQLITE_PRIVATE (line 95098) | SQLITE_PRIVATE char *sqlite3VdbeExpandSql(
  function sqlite_uint64 (line 95283) | __inline__ sqlite_uint64 sqlite3Hwtime(void){
  function sqlite_uint64 (line 95291) | __declspec(naked) __inline sqlite_uint64 __cdecl sqlite3Hwtime(void){
  function sqlite_uint64 (line 95302) | __inline__ sqlite_uint64 sqlite3Hwtime(void){
  function sqlite_uint64 (line 95310) | __inline__ sqlite_uint64 sqlite3Hwtime(void){
  function sqlite3Hwtime (line 95333) | sqlite3Hwtime(void){ return ((sqlite_uint64)0); }
  function updateMaxBlobsize (line 95401) | static void updateMaxBlobsize(Mem *p){
  function test_trace_breakpoint (line 95453) | static void test_trace_breakpoint(int pc, Op *pOp, Vdbe *v){
  function vdbeTakeBranch (line 95504) | static void vdbeTakeBranch(u32 iSrcLine, u8 I, u8 M){
  function VdbeCursor (line 95563) | static VdbeCursor *allocateCursor(
  function alsoAnInt (line 95639) | static int alsoAnInt(Mem *pRec, double rValue, i64 *piValue){
  function applyNumericAffinity (line 95664) | static void applyNumericAffinity(Mem *pRec, int bTryForInt){
  function applyAffinity (line 95708) | static void applyAffinity(
  function SQLITE_API (line 95747) | SQLITE_API int sqlite3_value_numeric_type(sqlite3_value *pVal){
  function SQLITE_PRIVATE (line 95761) | SQLITE_PRIVATE void sqlite3ValueApplyAffinity(
  function u16 (line 95775) | static u16 SQLITE_NOINLINE computeNumericType(Mem *pMem){
  function u16 (line 95806) | static u16 numericType(Mem *pMem){
  function SQLITE_PRIVATE (line 95827) | SQLITE_PRIVATE void sqlite3VdbeMemPrettyPrint(Mem *pMem, StrAccum *pStr){
  function memTracePrint (line 95890) | static void memTracePrint(Mem *p){
  function registerTrace (line 95916) | static void registerTrace(int iReg, Mem *p){
  function sqlite3PrintMem (line 95926) | void sqlite3PrintMem(Mem *pMem){
  function SQLITE_PRIVATE (line 95938) | SQLITE_PRIVATE void sqlite3VdbeRegisterDump(Vdbe *v){
  function checkSavepointCount (line 95962) | static int checkSavepointCount(sqlite3 *db){
  function SQLITE_NOINLINE (line 95975) | static SQLITE_NOINLINE Mem *out2PrereleaseWithClear(Mem *pOut){
  function Mem (line 95980) | static Mem *out2Prerelease(Vdbe *p, VdbeOp *pOp){
  function u64 (line 95998) | static u64 filterHash(const Mem *aMem, const Op *pOp){
  function SQLITE_NOINLINE (line 96027) | static SQLITE_NOINLINE int vdbeColumnFromOverflow(
  function SQLITE_NOINLINE (line 96108) | static SQLITE_NOINLINE void sqlite3VdbeLogAbort(
  function SQLITE_PRIVATE (line 96154) | SQLITE_PRIVATE int sqlite3VdbeExec(
  type Incrblob (line 104659) | typedef struct Incrblob Incrblob;
  type Incrblob (line 104660) | struct Incrblob {
  function blobSeekToRow (line 104689) | static int blobSeekToRow(Incrblob *p, sqlite3_int64 iRow, char **pzErr){
  function SQLITE_API (line 104756) | SQLITE_API int sqlite3_blob_open(
  function SQLITE_API (line 104995) | SQLITE_API int sqlite3_blob_close(sqlite3_blob *pBlob){
  function blobReadWrite (line 105016) | static int blobReadWrite(
  function SQLITE_API (line 105106) | SQLITE_API int sqlite3_blob_read(sqlite3_blob *pBlob, void *z, int n, in...
  function SQLITE_API (line 105113) | SQLITE_API int sqlite3_blob_write(sqlite3_blob *pBlob, const void *z, in...
  function SQLITE_API (line 105123) | SQLITE_API int sqlite3_blob_bytes(sqlite3_blob *pBlob){
  function SQLITE_API (line 105138) | SQLITE_API int sqlite3_blob_reopen(sqlite3_blob *pBlob, sqlite3_int64 iR...
  type MergeEngine (line 105332) | typedef struct MergeEngine MergeEngine;
  type PmaReader (line 105333) | typedef struct PmaReader PmaReader;
  type PmaWriter (line 105334) | typedef struct PmaWriter PmaWriter;
  type SorterRecord (line 105335) | typedef struct SorterRecord SorterRecord;
  type SortSubtask (line 105336) | typedef struct SortSubtask SortSubtask;
  type SorterFile (line 105337) | typedef struct SorterFile SorterFile;
  type SorterList (line 105338) | typedef struct SorterList SorterList;
  type IncrMerger (line 105339) | typedef struct IncrMerger IncrMerger;
  type SorterFile (line 105345) | struct SorterFile {
  type SorterList (line 105358) | struct SorterList {
  type MergeEngine (line 105428) | struct MergeEngine {
  type SortSubtask (line 105467) | struct SortSubtask {
  type VdbeSorter (line 105490) | struct VdbeSorter {
  type PmaReader (line 105526) | struct PmaReader {
  type IncrMerger (line 105572) | struct IncrMerger {
  type PmaWriter (line 105590) | struct PmaWriter {
  type SorterRecord (line 105619) | struct SorterRecord {
  function vdbePmaReaderClear (line 105646) | static void vdbePmaReaderClear(PmaReader *pReadr){
  function vdbePmaReadBlob (line 105663) | static int vdbePmaReadBlob(
  function vdbePmaReadVarint (line 105758) | static int vdbePmaReadVarint(PmaReader *p, u64 *pnOut){
  function vdbeSorterMapFile (line 105791) | static int vdbeSorterMapFile(SortSubtask *pTask, SorterFile *pFile, u8 *...
  function vdbePmaReaderSeek (line 105808) | static int vdbePmaReaderSeek(
  function vdbePmaReaderNext (line 105855) | static int vdbePmaReaderNext(PmaReader *pReadr){
  function vdbePmaReaderInit (line 105902) | static int vdbePmaReaderInit(
  function vdbeSorterCompareTail (line 105935) | static int vdbeSorterCompareTail(
  function vdbeSorterCompare (line 105962) | static int vdbeSorterCompare(
  function vdbeSorterCompareText (line 105981) | static int vdbeSorterCompareText(
  function vdbeSorterCompareInt (line 106024) | static int vdbeSorterCompareInt(
  function SQLITE_PRIVATE (line 106108) | SQLITE_PRIVATE int sqlite3VdbeSorterInit(
  function vdbeSorterRecordFree (line 106222) | static void vdbeSorterRecordFree(sqlite3 *db, SorterRecord *pRecord){
  function vdbeSortSubtaskCleanup (line 106235) | static void vdbeSortSubtaskCleanup(sqlite3 *db, SortSubtask *pTask){
  function vdbeSorterWorkDebug (line 106258) | static void vdbeSorterWorkDebug(SortSubtask *pTask, const char *zEvent){
  function vdbeSorterRewindDebug (line 106264) | static void vdbeSorterRewindDebug(const char *zEvent){
  function vdbeSorterPopulateDebug (line 106270) | static void vdbeSorterPopulateDebug(
  function vdbeSorterBlockDebug (line 106279) | static void vdbeSorterBlockDebug(
  function vdbeSorterJoinThread (line 106301) | static int vdbeSorterJoinThread(SortSubtask *pTask){
  function vdbeSorterCreateThread (line 106322) | static int vdbeSorterCreateThread(
  function vdbeSorterJoinAll (line 106335) | static int vdbeSorterJoinAll(VdbeSorter *pSorter, int rcin){
  function MergeEngine (line 106365) | static MergeEngine *vdbeMergeEngineNew(int nReader){
  function vdbeMergeEngineFree (line 106388) | static void vdbeMergeEngineFree(MergeEngine *pMerger){
  function vdbeIncrFree (line 106402) | static void vdbeIncrFree(IncrMerger *pIncr){
  function SQLITE_PRIVATE (line 106419) | SQLITE_PRIVATE void sqlite3VdbeSorterReset(sqlite3 *db, VdbeSorter *pSor...
  function SQLITE_PRIVATE (line 106452) | SQLITE_PRIVATE void sqlite3VdbeSorterClose(sqlite3 *db, VdbeCursor *pCsr){
  function vdbeSorterExtendFile (line 106480) | static void vdbeSorterExtendFile(sqlite3 *db, sqlite3_file *pFd, i64 nBy...
  function vdbeSorterOpenTempFile (line 106499) | static int vdbeSorterOpenTempFile(
  function vdbeSortAllocUnpacked (line 106526) | static int vdbeSortAllocUnpacked(SortSubtask *pTask){
  function SorterRecord (line 106540) | static SorterRecord *vdbeSorterMerge(
  function SorterCompare (line 106582) | static SorterCompare vdbeSorterGetCompare(VdbeSorter *p){
  function vdbeSorterSort (line 106596) | static int vdbeSorterSort(SortSubtask *pTask, SorterList *pList){
  function vdbePmaWriterInit (line 106651) | static void vdbePmaWriterInit(
  function vdbePmaWriteBlob (line 106673) | static void vdbePmaWriteBlob(PmaWriter *p, u8 *pData, int nData){
  function vdbePmaWriterFinish (line 106708) | static int vdbePmaWriterFinish(PmaWriter *p, i64 *piEof, u64 *pnSpill){
  function vdbePmaWriteVarint (line 106729) | static void vdbePmaWriteVarint(PmaWriter *p, u64 iVal){
  function vdbeSorterListToPMA (line 106750) | static int vdbeSorterListToPMA(SortSubtask *pTask, SorterList *pList){
  function vdbeMergeEngineStep (line 106814) | static int vdbeMergeEngineStep(
  function vdbeSorterFlushPMA (line 106899) | static int vdbeSorterFlushPMA(VdbeSorter *pSorter){
  function SQLITE_PRIVATE (line 106969) | SQLITE_PRIVATE int sqlite3VdbeSorterWrite(
  function vdbeIncrPopulate (line 107081) | static int vdbeIncrPopulate(IncrMerger *pIncr){
  function vdbeIncrBgPopulate (line 107133) | static int vdbeIncrBgPopulate(IncrMerger *pIncr){
  function vdbeIncrSwap (line 107157) | static int vdbeIncrSwap(IncrMerger *pIncr){
  function vdbeIncrMergerNew (line 107196) | static int vdbeIncrMergerNew(
  function vdbeIncrMergerSetThreads (line 107221) | static void vdbeIncrMergerSetThreads(IncrMerger *pIncr){
  function vdbeMergeEngineCompare (line 107234) | static void vdbeMergeEngineCompare(
  function vdbeMergeEngineInit (line 107316) | static int vdbeMergeEngineInit(
  function vdbePmaReaderIncrMergeInit (line 107392) | static int vdbePmaReaderIncrMergeInit(PmaReader *pReadr, int eMode){
  function vdbePmaReaderIncrInit (line 107480) | static int vdbePmaReaderIncrInit(PmaReader *pReadr, int eMode){
  function vdbeMergeEngineLevel0 (line 107510) | static int vdbeMergeEngineLevel0(
  function vdbeSorterTreeDepth (line 107549) | static int vdbeSorterTreeDepth(int nPMA){
  function vdbeSorterAddToTree (line 107567) | static int vdbeSorterAddToTree(
  function vdbeSorterMergeTreeBuild (line 107623) | static int vdbeSorterMergeTreeBuild(
  function vdbeSorterSetupMerge (line 107702) | static int vdbeSorterSetupMerge(VdbeSorter *pSorter){
  function SQLITE_PRIVATE (line 107784) | SQLITE_PRIVATE int sqlite3VdbeSorterRewind(const VdbeCursor *pCsr, int *...
  function SQLITE_PRIVATE (line 107836) | SQLITE_PRIVATE int sqlite3VdbeSorterNext(sqlite3 *db, const VdbeCursor *...
  function SQLITE_PRIVATE (line 107901) | SQLITE_PRIVATE int sqlite3VdbeSorterRowkey(const VdbeCursor *pCsr, Mem *...
  function SQLITE_PRIVATE (line 107934) | SQLITE_PRIVATE int sqlite3VdbeSorterCompare(
  type bytecodevtab (line 107993) | typedef struct bytecodevtab bytecodevtab;
  type bytecodevtab (line 107994) | struct bytecodevtab {
  type bytecodevtab_cursor (line 108002) | typedef struct bytecodevtab_cursor bytecodevtab_cursor;
  type bytecodevtab_cursor (line 108003) | struct bytecodevtab_cursor {
  function bytecodevtabConnect (line 108021) | static int bytecodevtabConnect(
  function bytecodevtabDisconnect (line 108077) | static int bytecodevtabDisconnect(sqlite3_vtab *pVtab){
  function bytecodevtabOpen (line 108086) | static int bytecodevtabOpen(sqlite3_vtab *p, sqlite3_vtab_cursor **ppCur...
  function bytecodevtabCursorClear (line 108100) | static void bytecodevtabCursorClear(bytecodevtab_cursor *pCur){
  function bytecodevtabClose (line 108118) | static int bytecodevtabClose(sqlite3_vtab_cursor *cur){
  function bytecodevtabNext (line 108129) | static int bytecodevtabNext(sqlite3_vtab_cursor *cur){
  function bytecodevtabEof (line 108160) | static int bytecodevtabEof(sqlite3_vtab_cursor *cur){
  function bytecodevtabColumn (line 108169) | static int bytecodevtabColumn(
  function bytecodevtabRowid (line 108292) | static int bytecodevtabRowid(sqlite3_vtab_cursor *cur, sqlite_int64 *pRo...
  function bytecodevtabFilter (line 108304) | static int bytecodevtabFilter(
  function bytecodevtabBestIndex (line 108347) | static int bytecodevtabBestIndex(
  function SQLITE_PRIVATE (line 108407) | SQLITE_PRIVATE int sqlite3VdbeBytecodeVtabInit(sqlite3 *db){
  function SQLITE_PRIVATE (line 108416) | SQLITE_PRIVATE int sqlite3VdbeBytecodeVtabInit(sqlite3 *db){ return SQLI...
  type MemJournal (line 108449) | typedef struct MemJournal MemJournal;
  type FilePoint (line 108450) | typedef struct FilePoint FilePoint;
  type FileChunk (line 108451) | typedef struct FileChunk FileChunk;
  type FileChunk (line 108459) | struct FileChunk {
  type FilePoint (line 108479) | struct FilePoint {
  type MemJournal (line 108488) | struct MemJournal {
  function memjrnlRead (line 108506) | static int memjrnlRead(
  function memjrnlFreeChunks (line 108553) | static void memjrnlFreeChunks(FileChunk *pFirst){
  function memjrnlCreateFile (line 108565) | static int memjrnlCreateFile(MemJournal *p){
  function memjrnlWrite (line 108607) | static int memjrnlWrite(
  function memjrnlTruncate (line 108680) | static int memjrnlTruncate(sqlite3_file *pJfd, sqlite_int64 size){
  function memjrnlClose (line 108710) | static int memjrnlClose(sqlite3_file *pJfd){
  function memjrnlSync (line 108722) | static int memjrnlSync(sqlite3_file *pJfd, int flags){
  function memjrnlFileSize (line 108730) | static int memjrnlFileSize(sqlite3_file *pJfd, sqlite_int64 *pSize){
  type sqlite3_io_methods (line 108739) | struct sqlite3_io_methods
  function SQLITE_PRIVATE (line 108773) | SQLITE_PRIVATE int sqlite3JournalOpen(
  function SQLITE_PRIVATE (line 108811) | SQLITE_PRIVATE void sqlite3MemJournalOpen(sqlite3_file *pJfd){
  function SQLITE_PRIVATE (line 108850) | SQLITE_PRIVATE int sqlite3JournalIsInMemory(sqlite3_file *p){
  function SQLITE_PRIVATE (line 108858) | SQLITE_PRIVATE int sqlite3JournalSize(sqlite3_vfs *pVfs){
  function walkWindowList (line 108888) | static int walkWindowList(Walker *pWalker, Window *pList, int bOneOnly){
  function sqlite3WalkExprNN (line 108927) | int sqlite3WalkExprNN(Walker *pWalker, Expr *pExpr){
  function SQLITE_PRIVATE (line 108961) | SQLITE_PRIVATE int sqlite3WalkExpr(Walker *pWalker, Expr *pExpr){
  function SQLITE_PRIVATE (line 108969) | SQLITE_PRIVATE int sqlite3WalkExprList(Walker *pWalker, ExprList *p){
  function SQLITE_PRIVATE (line 108984) | SQLITE_PRIVATE void sqlite3WalkWinDefnDummyCallback(Walker *pWalker, Sel...
  function SQLITE_PRIVATE (line 108996) | SQLITE_PRIVATE int sqlite3WalkSelectExpr(Walker *pWalker, Select *p){
  function SQLITE_PRIVATE (line 109029) | SQLITE_PRIVATE int sqlite3WalkSelectFrom(Walker *pWalker, Select *p){
  function SQLITE_PRIVATE (line 109069) | SQLITE_PRIVATE int sqlite3WalkSelect(Walker *pWalker, Select *p){
  function SQLITE_PRIVATE (line 109092) | SQLITE_PRIVATE int sqlite3WalkerDepthIncrease(Walker *pWalker, Select *p...
  function SQLITE_PRIVATE (line 109097) | SQLITE_PRIVATE void sqlite3WalkerDepthDecrease(Walker *pWalker, Select *...
  function SQLITE_PRIVATE (line 109112) | SQLITE_PRIVATE int sqlite3ExprWalkNoop(Walker *NotUsed, Expr *NotUsed2){
  function SQLITE_PRIVATE (line 109121) | SQLITE_PRIVATE int sqlite3SelectWalkNoop(Walker *NotUsed, Select *NotUse...
  function incrAggDepth (line 109162) | static int incrAggDepth(Walker *pWalker, Expr *pExpr){
  function incrAggFunctionDepth (line 109166) | static void incrAggFunctionDepth(Expr *pExpr, int N){
  function resolveAlias (line 109195) | static void resolveAlias(
  function SQLITE_PRIVATE (line 109252) | SQLITE_PRIVATE int sqlite3MatchEName(
  function areDoubleQuotedStringsEnabled (line 109288) | static int areDoubleQuotedStringsEnabled(sqlite3 *db, NameContext *pTopNC){
  function SQLITE_PRIVATE (line 109306) | SQLITE_PRIVATE Bitmask sqlite3ExprColUsed(Expr *pExpr){
  function extendFJMatch (line 109335) | static void extendFJMatch(
  function SQLITE_NOINLINE (line 109355) | static SQLITE_NOINLINE int isValidSchemaTableName(
  function lookupName (line 109405) | static int lookupName(
  function SQLITE_PRIVATE (line 109990) | SQLITE_PRIVATE Expr *sqlite3CreateColumnExpr(sqlite3 *db, SrcList *pSrc,...
  function notValidImpl (line 110034) | static void notValidImpl(
  function exprProbability (line 110062) | static int exprProbability(Expr *p){
  function resolveExprStep (line 110083) | static int resolveExprStep(Walker *pWalker, Expr *pExpr){
  function resolveAsName (line 110599) | static int resolveAsName(
  function resolveOrderByTermToExprList (line 110641) | static int resolveOrderByTermToExprList(
  function resolveOutOfRangeError (line 110688) | static void resolveOutOfRangeError(
  function resolveCompoundOrderBy (line 110716) | static int resolveCompoundOrderBy(
  function SQLITE_PRIVATE (line 110829) | SQLITE_PRIVATE int sqlite3ResolveOrderGroupBy(
  function resolveRemoveWindowsCb (line 110863) | static int resolveRemoveWindowsCb(Walker *pWalker, Expr *pExpr){
  function windowRemoveExprFromSelect (line 110876) | static void windowRemoveExprFromSelect(Select *pSelect, Expr *pExpr){
  function resolveOrderGroupBy (line 110907) | static int resolveOrderGroupBy(
  function resolveSelectStep (line 110970) | static int resolveSelectStep(Walker *pWalker, Select *p){
  function SQLITE_PRIVATE (line 111281) | SQLITE_PRIVATE int sqlite3ResolveExprNames(
  function SQLITE_PRIVATE (line 111324) | SQLITE_PRIVATE int sqlite3ResolveExprListNames(
  function SQLITE_PRIVATE (line 111380) | SQLITE_PRIVATE void sqlite3ResolveSelectNames(
  function SQLITE_PRIVATE (line 111414) | SQLITE_PRIVATE int sqlite3ResolveSelfReference(
  function SQLITE_PRIVATE (line 111479) | SQLITE_PRIVATE char sqlite3TableColumnAffinity(const Table *pTab, int iC...
  function SQLITE_PRIVATE (line 111500) | SQLITE_PRIVATE char sqlite3ExprAffinity(const Expr *pExpr){
  function SQLITE_PRIVATE (line 111562) | SQLITE_PRIVATE int sqlite3ExprDataType(const Expr *pExpr){
  function SQLITE_PRIVATE (line 111630) | SQLITE_PRIVATE Expr *sqlite3ExprAddCollateToken(
  function SQLITE_PRIVATE (line 111646) | SQLITE_PRIVATE Expr *sqlite3ExprAddCollateString(
  function SQLITE_PRIVATE (line 111660) | SQLITE_PRIVATE Expr *sqlite3ExprSkipCollate(Expr *pExpr){
  function SQLITE_PRIVATE (line 111673) | SQLITE_PRIVATE Expr *sqlite3ExprSkipCollateAndLikely(Expr *pExpr){
  function SQLITE_PRIVATE (line 111703) | SQLITE_PRIVATE CollSeq *sqlite3ExprCollSeq(Parse *pParse, const Expr *pE...
  function SQLITE_PRIVATE (line 111776) | SQLITE_PRIVATE CollSeq *sqlite3ExprNNCollSeq(Parse *pParse, const Expr *...
  function SQLITE_PRIVATE (line 111786) | SQLITE_PRIVATE int sqlite3ExprCollSeqMatch(Parse *pParse, const Expr *pE...
  function SQLITE_PRIVATE (line 111797) | SQLITE_PRIVATE char sqlite3CompareAffinity(const Expr *pExpr, char aff2){
  function comparisonAffinity (line 111819) | static char comparisonAffinity(const Expr *pExpr){
  function SQLITE_PRIVATE (line 111842) | SQLITE_PRIVATE int sqlite3IndexAffinityOk(const Expr *pExpr, char idx_af...
  function u8 (line 111857) | static u8 binaryCompareP5(
  function SQLITE_PRIVATE (line 111879) | SQLITE_PRIVATE CollSeq *sqlite3BinaryCompareCollSeq(
  function SQLITE_PRIVATE (line 111907) | SQLITE_PRIVATE CollSeq *sqlite3ExprCompareCollSeq(Parse *pParse, const E...
  function codeCompare (line 111918) | static int codeCompare(
  function SQLITE_PRIVATE (line 111954) | SQLITE_PRIVATE int sqlite3ExprIsVector(const Expr *pExpr){
  function SQLITE_PRIVATE (line 111964) | SQLITE_PRIVATE int sqlite3ExprVectorSize(const Expr *pExpr){
  function SQLITE_PRIVATE (line 111993) | SQLITE_PRIVATE Expr *sqlite3VectorFieldSubexpr(Expr *pVector, int i){
  function SQLITE_PRIVATE (line 112029) | SQLITE_PRIVATE Expr *sqlite3ExprForVectorField(
  function exprCodeSubselect (line 112086) | static int exprCodeSubselect(Parse *pParse, Expr *pExpr){
  function exprVectorRegister (line 112114) | static int exprVectorRegister(
  function codeVectorCompare (line 112152) | static void codeVectorCompare(
  function SQLITE_PRIVATE (line 112247) | SQLITE_PRIVATE int sqlite3ExprCheckHeight(Parse *pParse, int nHeight){
  function heightOfExpr (line 112268) | static void heightOfExpr(const Expr *p, int *pnHeight){
  function heightOfExprList (line 112275) | static void heightOfExprList(const ExprList *p, int *pnHeight){
  function heightOfSelect (line 112283) | static void heightOfSelect(const Select *pSelect, int *pnHeight){
  function exprSetHeight (line 112305) | static void exprSetHeight(Expr *p){
  function SQLITE_PRIVATE (line 112327) | SQLITE_PRIVATE void sqlite3ExprSetHeightAndFlags(Parse *pParse, Expr *p){
  function SQLITE_PRIVATE (line 112337) | SQLITE_PRIVATE int sqlite3SelectExprHeight(const Select *p){
  function SQLITE_PRIVATE (line 112347) | SQLITE_PRIVATE void sqlite3ExprSetHeightAndFlags(Parse *pParse, Expr *p){
  function SQLITE_PRIVATE (line 112359) | SQLITE_PRIVATE void sqlite3ExprSetErrorOffset(Expr *pExpr, int iOfst){
  function SQLITE_PRIVATE (line 112386) | SQLITE_PRIVATE Expr *sqlite3ExprAlloc(
  function SQLITE_PRIVATE (line 112434) | SQLITE_PRIVATE Expr *sqlite3Expr(
  function SQLITE_PRIVATE (line 112451) | SQLITE_PRIVATE void sqlite3ExprAttachSubtrees(
  function SQLITE_PRIVATE (line 112492) | SQLITE_PRIVATE Expr *sqlite3PExpr(
  function SQLITE_PRIVATE (line 112517) | SQLITE_PRIVATE void sqlite3PExprAddSelect(Parse *pParse, Expr *pExpr, Se...
  function SQLITE_PRIVATE (line 112547) | SQLITE_PRIVATE Select *sqlite3ExprListToValues(Parse *pParse, int nElem,...
  function SQLITE_PRIVATE (line 112594) | SQLITE_PRIVATE Expr *sqlite3ExprAnd(Parse *pParse, Expr *pLeft, Expr *pR...
  function SQLITE_PRIVATE (line 112618) | SQLITE_PRIVATE Expr *sqlite3ExprFunction(
  function SQLITE_PRIVATE (line 112652) | SQLITE_PRIVATE void sqlite3ExprOrderByAggregateError(Parse *pParse, Expr...
  function SQLITE_PRIVATE (line 112668) | SQLITE_PRIVATE void sqlite3ExprAddFunctionOrderBy(
  function SQLITE_PRIVATE (line 112725) | SQLITE_PRIVATE void sqlite3ExprFunctionUsable(
  function SQLITE_PRIVATE (line 112764) | SQLITE_PRIVATE void sqlite3ExprAssignVarNumber(Parse *pParse, Expr *pExp...
  function SQLITE_NOINLINE (line 112834) | static SQLITE_NOINLINE void sqlite3ExprDeleteNN(sqlite3 *db, Expr *p){
  function SQLITE_PRIVATE (line 112885) | SQLITE_PRIVATE void sqlite3ExprDelete(sqlite3 *db, Expr *p){
  function SQLITE_PRIVATE (line 112888) | SQLITE_PRIVATE void sqlite3ExprDeleteGeneric(sqlite3 *db, void *p){
  function SQLITE_PRIVATE (line 112895) | SQLITE_PRIVATE void sqlite3ClearOnOrUsing(sqlite3 *db, OnOrUsing *p){
  function SQLITE_PRIVATE (line 112915) | SQLITE_PRIVATE int sqlite3ExprDeferredDelete(Parse *pParse, Expr *pExpr){
  function SQLITE_PRIVATE (line 112922) | SQLITE_PRIVATE void sqlite3ExprUnmapAndDelete(Parse *pParse, Expr *p){
  function exprStructSize (line 112936) | static int exprStructSize(const Expr *p){
  function dupedExprStructSize (line 112976) | static int dupedExprStructSize(const Expr *p, int flags){
  function dupedExprNodeSize (line 113002) | static int dupedExprNodeSize(const Expr *p, int flags){
  function dupedExprSize (line 113021) | static int dupedExprSize(const Expr *p){
  type EdupBuf (line 113039) | typedef struct EdupBuf EdupBuf;
  type EdupBuf (line 113040) | struct EdupBuf {
  function Expr (line 113053) | static Expr *exprDup(
  function SQLITE_PRIVATE (line 113202) | SQLITE_PRIVATE With *sqlite3WithDup(sqlite3 *db, With *p){
  function gatherSelectWindowsCallback (line 113231) | static int gatherSelectWindowsCallback(Walker *pWalker, Expr *pExpr){
  function gatherSelectWindowsSelectCallback (line 113242) | static int gatherSelectWindowsSelectCallback(Walker *pWalker, Select *p){
  function gatherSelectWindows (line 113245) | static void gatherSelectWindows(Select *p){
  function SQLITE_PRIVATE (line 113274) | SQLITE_PRIVATE Expr *sqlite3ExprDup(sqlite3 *db, const Expr *p, int flags){
  function SQLITE_PRIVATE (line 113278) | SQLITE_PRIVATE ExprList *sqlite3ExprListDup(sqlite3 *db, const ExprList ...
  function SQLITE_PRIVATE (line 113329) | SQLITE_PRIVATE SrcList *sqlite3SrcListDup(sqlite3 *db, const SrcList *p,...
  function SQLITE_PRIVATE (line 113391) | SQLITE_PRIVATE IdList *sqlite3IdListDup(sqlite3 *db, const IdList *p){
  function SQLITE_PRIVATE (line 113406) | SQLITE_PRIVATE Select *sqlite3SelectDup(sqlite3 *db, const Select *pDup,...
  function SQLITE_PRIVATE (line 113454) | SQLITE_PRIVATE Select *sqlite3SelectDup(sqlite3 *db, const Select *p, in...
  type ExprList_item (line 113472) | struct ExprList_item
  function ExprList (line 113473) | ExprList *sqlite3ExprListAppendNew(
  function ExprList (line 113492) | ExprList *sqlite3ExprListAppendGrow(
  function SQLITE_PRIVATE (line 113513) | SQLITE_PRIVATE ExprList *sqlite3ExprListAppend(
  function SQLITE_PRIVATE (line 113542) | SQLITE_PRIVATE ExprList *sqlite3ExprListAppendVector(
  function SQLITE_PRIVATE (line 113604) | SQLITE_PRIVATE void sqlite3ExprListSetSortOrder(ExprList *p, int iSortOr...
  function SQLITE_PRIVATE (line 113642) | SQLITE_PRIVATE void sqlite3ExprListSetName(
  function SQLITE_PRIVATE (line 113677) | SQLITE_PRIVATE void sqlite3ExprListSetSpan(
  function SQLITE_PRIVATE (line 113699) | SQLITE_PRIVATE void sqlite3ExprListCheckLength(
  function SQLITE_NOINLINE (line 113715) | static SQLITE_NOINLINE void exprListDeleteNN(sqlite3 *db, ExprList *pList){
  function SQLITE_PRIVATE (line 113727) | SQLITE_PRIVATE void sqlite3ExprListDelete(sqlite3 *db, ExprList *pList){
  function SQLITE_PRIVATE (line 113730) | SQLITE_PRIVATE void sqlite3ExprListDeleteGeneric(sqlite3 *db, void *pList){
  function SQLITE_PRIVATE (line 113738) | SQLITE_PRIVATE u32 sqlite3ExprListFlags(const ExprList *pList){
  function SQLITE_PRIVATE (line 113757) | SQLITE_PRIVATE int sqlite3SelectWalkFail(Walker *pWalker, Select *NotUsed){
  function SQLITE_PRIVATE (line 113771) | SQLITE_PRIVATE u32 sqlite3IsTrueOrFalse(const char *zIn){
  function SQLITE_PRIVATE (line 113783) | SQLITE_PRIVATE int sqlite3ExprIdToTrueFalse(Expr *pExpr){
  function SQLITE_PRIVATE (line 113800) | SQLITE_PRIVATE int sqlite3ExprTruthValue(const Expr *pExpr){
  function SQLITE_PRIVATE (line 113822) | SQLITE_PRIVATE Expr *sqlite3ExprSimplifiedAndOr(Expr *pExpr){
  function exprEvalRhsFirst (line 113844) | static int exprEvalRhsFirst(Expr *pExpr){
  function exprComputeOperands (line 113866) | static int exprComputeOperands(
  function SQLITE_NOINLINE (line 113931) | static SQLITE_NOINLINE int exprNodeIsConstantFunction(
  function exprNodeIsConstant (line 113990) | static int exprNodeIsConstant(Walker *pWalker, Expr *pExpr){
  function exprIsConst (line 114067) | static int exprIsConst(Parse *pParse, Expr *p, int initFlag){
  function SQLITE_PRIVATE (line 114094) | SQLITE_PRIVATE int sqlite3ExprIsConstant(Parse *pParse, Expr *p){
  function sqlite3ExprIsConstantNotJoin (line 114111) | static int sqlite3ExprIsConstantNotJoin(Parse *pParse, Expr *p){
  function exprSelectWalkTableConstant (line 114121) | static int exprSelectWalkTableConstant(Walker *pWalker, Select *pSelect){
  function sqlite3ExprIsTableConstant (line 114140) | static int sqlite3ExprIsTableConstant(Expr *p, int iCur, int bAllowSubq){
  function SQLITE_PRIVATE (line 114202) | SQLITE_PRIVATE int sqlite3ExprIsSingleTableConstraint(
  function exprNodeIsConstantOrGroupBy (line 114239) | static int exprNodeIsConstantOrGroupBy(Walker *pWalker, Expr *pExpr){
  function SQLITE_PRIVATE (line 114283) | SQLITE_PRIVATE int sqlite3ExprIsConstantOrGroupBy(Parse *pParse, Expr *p...
  function SQLITE_PRIVATE (line 114315) | SQLITE_PRIVATE int sqlite3ExprIsConstantOrFunction(Expr *p, u8 isInit){
  function SQLITE_PRIVATE (line 114325) | SQLITE_PRIVATE int sqlite3ExprContainsSubquery(Expr *p){
  function SQLITE_PRIVATE (line 114348) | SQLITE_PRIVATE int sqlite3ExprIsInteger(const Expr *p, int *pValue, Pars...
  function SQLITE_PRIVATE (line 114414) | SQLITE_PRIVATE int sqlite3ExprCanBeNull(const Expr *p){
  function SQLITE_PRIVATE (line 114455) | SQLITE_PRIVATE int sqlite3ExprNeedsNoAffinityChange(const Expr *p, char ...
  function SQLITE_PRIVATE (line 114491) | SQLITE_PRIVATE int sqlite3IsRowid(const char *z){
  function SQLITE_PRIVATE (line 114503) | SQLITE_PRIVATE const char *sqlite3RowidAlias(Table *pTab){
  function Select (line 114521) | static Select *isCandidateForInOpt(const Expr *pX){
  function sqlite3SetHasNullFlag (line 114566) | static void sqlite3SetHasNullFlag(Vdbe *v, int iCur, int regHasNull){
  function sqlite3InRhsIsConstant (line 114583) | static int sqlite3InRhsIsConstant(Parse *pParse, Expr *pIn){
  function SQLITE_PRIVATE (line 114679) | SQLITE_PRIVATE int sqlite3FindInIndex(
  function SQLITE_PRIVATE (line 114937) | SQLITE_PRIVATE void sqlite3SubselectError(Parse *pParse, int nActual, in...
  function SQLITE_PRIVATE (line 114956) | SQLITE_PRIVATE void sqlite3VectorErrorMsg(Parse *pParse, Expr *pExpr){
  function findCompatibleInRhsSubrtn (line 114973) | static int findCompatibleInRhsSubrtn(
  function SQLITE_PRIVATE (line 115034) | SQLITE_PRIVATE void sqlite3CodeRhsOfIN(
  function SQLITE_PRIVATE (line 115279) | SQLITE_PRIVATE int sqlite3CodeSubselect(Parse *pParse, Expr *pExpr){
  function SQLITE_PRIVATE (line 115426) | SQLITE_PRIVATE int sqlite3ExprCheckIN(Parse *pParse, Expr *pIn){
  function sqlite3ExprCodeIN (line 115467) | static void sqlite3ExprCodeIN(
  function codeReal (line 115740) | static void codeReal(Vdbe *v, const char *z, int negateFlag, int iMem){
  function codeInteger (line 115758) | static void codeInteger(Parse *pParse, Expr *pExpr, int negFlag, int iMem){
  function SQLITE_PRIVATE (line 115796) | SQLITE_PRIVATE void sqlite3ExprCodeLoadIndexColumn(
  function SQLITE_PRIVATE (line 115821) | SQLITE_PRIVATE void sqlite3ExprCodeGeneratedColumn(
  function SQLITE_PRIVATE (line 115854) | SQLITE_PRIVATE void sqlite3ExprCodeGetColumnOfTable(
  function SQLITE_PRIVATE (line 115911) | SQLITE_PRIVATE int sqlite3ExprCodeGetColumn(
  function SQLITE_PRIVATE (line 115935) | SQLITE_PRIVATE void sqlite3ExprCodeMove(Parse *pParse, int iFrom, int iT...
  function SQLITE_PRIVATE (line 115944) | SQLITE_PRIVATE void sqlite3ExprToRegister(Expr *pExpr, int iReg){
  function exprCodeVector (line 115967) | static int exprCodeVector(Parse *pParse, Expr *p, int *piFreeable){
  function setDoNotMergeFlagOnCopy (line 115997) | static void setDoNotMergeFlagOnCopy(Vdbe *v){
  function exprCodeInlineFunction (line 116007) | static int exprCodeInlineFunction(
  function exprNodeCanReturnSubtype (line 116141) | static int exprNodeCanReturnSubtype(Walker *pWalker, Expr *pExpr){
  function sqlite3ExprCanReturnSubtype (line 116167) | static int sqlite3ExprCanReturnSubtype(Parse *pParse, Expr *pExpr){
  function SQLITE_NOINLINE (line 116183) | static SQLITE_NOINLINE int sqlite3IndexedExprLookup(
  function exprPartidxExprLookup (line 116257) | static int exprPartidxExprLookup(Parse *pParse, Expr *pExpr, int iTarget){
  function SQLITE_NOINLINE (line 116291) | static SQLITE_NOINLINE int exprCodeTargetAndOr(
  function SQLITE_PRIVATE (line 116367) | SQLITE_PRIVATE int sqlite3ExprCodeTarget(Parse *pParse, Expr *pExpr, int...
  function SQLITE_PRIVATE (line 117214) | SQLITE_PRIVATE int sqlite3ExprCodeRunJustOnce(
  function sqlite3ExprNullRegisterRange (line 117265) | void sqlite3ExprNullRegisterRange(
  function SQLITE_PRIVATE (line 117293) | SQLITE_PRIVATE int sqlite3ExprCodeTemp(Parse *pParse, Expr *pExpr, int *...
  function SQLITE_PRIVATE (line 117321) | SQLITE_PRIVATE void sqlite3ExprCode(Parse *pParse, Expr *pExpr, int targ...
  function SQLITE_PRIVATE (line 117349) | SQLITE_PRIVATE void sqlite3ExprCodeCopy(Parse *pParse, Expr *pExpr, int ...
  function SQLITE_PRIVATE (line 117362) | SQLITE_PRIVATE void sqlite3ExprCodeFactorable(Parse *pParse, Expr *pExpr...
  function SQLITE_PRIVATE (line 117390) | SQLITE_PRIVATE int sqlite3ExprCodeExprList(
  function exprCodeBetween (line 117465) | static void exprCodeBetween(
  function SQLITE_PRIVATE (line 117537) | SQLITE_PRIVATE void sqlite3ExprIfTrue(Parse *pParse, Expr *pExpr, int de...
  function SQLITE_PRIVATE (line 117703) | SQLITE_PRIVATE void sqlite3ExprIfFalse(Parse *pParse, Expr *pExpr, int d...
  function SQLITE_PRIVATE (line 117899) | SQLITE_PRIVATE void sqlite3ExprIfFalseDup(Parse *pParse, Expr *pExpr, in...
  function SQLITE_NOINLINE (line 117924) | static SQLITE_NOINLINE int exprCompareVariable(
  function SQLITE_PRIVATE (line 117981) | SQLITE_PRIVATE int sqlite3ExprCompare(
  function SQLITE_PRIVATE (line 118083) | SQLITE_PRIVATE int sqlite3ExprListCompare(const ExprList *pA, const Expr...
  function SQLITE_PRIVATE (line 118102) | SQLITE_PRIVATE int sqlite3ExprCompareSkip(Expr *pA,Expr *pB, int iTab){
  function exprImpliesNotNull (line 118115) | static int exprImpliesNotNull(
  function sqlite3ExprIsNotTrue (line 118191) | static int sqlite3ExprIsNotTrue(Expr *pExpr){
  function sqlite3ExprIsIIF (line 118210) | static int sqlite3ExprIsIIF(sqlite3 *db, const Expr *pExpr){
  function SQLITE_PRIVATE (line 118264) | SQLITE_PRIVATE int sqlite3ExprImpliesExpr(
  function bothImplyNotNullRow (line 118294) | static void bothImplyNotNullRow(Walker *pWalker, Expr *pE1, Expr *pE2){
  function impliesNotNullRow (line 118317) | static int impliesNotNullRow(Walker *pWalker, Expr *pExpr){
  function SQLITE_PRIVATE (line 118448) | SQLITE_PRIVATE int sqlite3ExprImpliesNonNullRow(Expr *p, int iTab, int i...
  type IdxCover (line 118477) | struct IdxCover {
  function exprIdxCover (line 118487) | static int exprIdxCover(Walker *pWalker, Expr *pExpr){
  function SQLITE_PRIVATE (line 118508) | SQLITE_PRIVATE int sqlite3ExprCoveredByIndex(
  type RefSrcList (line 118528) | struct RefSrcList {
  function selectRefEnter (line 118543) | static int selectRefEnter(Walker *pWalker, Select *pSelect){
  function selectRefLeave (line 118563) | static void selectRefLeave(Walker *pWalker, Select *pSelect){
  function exprRefToSrcList (line 118580) | static int exprRefToSrcList(Walker *pWalker, Expr *pExpr){
  function SQLITE_PRIVATE (line 118617) | SQLITE_PRIVATE int sqlite3ReferencesSrcList(Parse *pParse, Expr *pExpr, ...
  function agginfoPersistExprCb (line 118664) | static int agginfoPersistExprCb(Walker *pWalker, Expr *pExpr){
  function SQLITE_PRIVATE (line 118701) | SQLITE_PRIVATE void sqlite3AggInfoPersistWalkerInit(Walker *pWalker, Par...
  function addAggInfoColumn (line 118712) | static int addAggInfoColumn(sqlite3 *db, AggInfo *pInfo){
  function addAggInfoFunc (line 118728) | static int addAggInfoFunc(sqlite3 *db, AggInfo *pInfo){
  function findOrCreateAggInfoColumn (line 118747) | static void findOrCreateAggInfoColumn(
  function analyzeAggregate (line 118820) | static int analyzeAggregate(Walker *pWalker, Expr *pExpr){
  function SQLITE_PRIVATE (line 118983) | SQLITE_PRIVATE void sqlite3ExprAnalyzeAggregates(NameContext *pNC, Expr ...
  function SQLITE_PRIVATE (line 119001) | SQLITE_PRIVATE void sqlite3ExprAnalyzeAggList(NameContext *pNC, ExprList...
  function SQLITE_PRIVATE (line 119014) | SQLITE_PRIVATE int sqlite3GetTempReg(Parse *pParse){
  function SQLITE_PRIVATE (line 119025) | SQLITE_PRIVATE void sqlite3ReleaseTempReg(Parse *pParse, int iReg){
  function SQLITE_PRIVATE (line 119037) | SQLITE_PRIVATE int sqlite3GetTempRange(Parse *pParse, int nReg){
  function SQLITE_PRIVATE (line 119051) | SQLITE_PRIVATE void sqlite3ReleaseTempRange(Parse *pParse, int iReg, int...
  function SQLITE_PRIVATE (line 119071) | SQLITE_PRIVATE void sqlite3ClearTempRegCache(Parse *pParse){
  function SQLITE_PRIVATE (line 119080) | SQLITE_PRIVATE void sqlite3TouchRegister(Parse *pParse, int iReg){
  function SQLITE_PRIVATE (line 119091) | SQLITE_PRIVATE int sqlite3FirstAvailableRegister(Parse *pParse, int iMin){
  function SQLITE_PRIVATE (line 119113) | SQLITE_PRIVATE int sqlite3NoTempsInRange(Parse *pParse, int iFirst, int ...
  function isAlterableTable (line 119170) | static int isAlterableTable(Parse *pParse, Table *pTab){
  function renameTestSchema (line 119192) | static void renameTestSchema(
  function renameFixQuotes (line 119229) | static void renameFixQuotes(Parse *pParse, const char *zDb, int bTemp){
  function renameReloadSchema (line 119250) | static void renameReloadSchema(Parse *pParse, int iDb, u16 p5){
  function SQLITE_PRIVATE (line 119263) | SQLITE_PRIVATE void sqlite3AlterRenameTable(
  function sqlite3ErrorIfNotEmpty (line 119432) | static void sqlite3ErrorIfNotEmpty(
  function SQLITE_PRIVATE (line 119452) | SQLITE_PRIVATE void sqlite3AlterFinishAddColumn(Parse *pParse, Token *pC...
  function SQLITE_PRIVATE (line 119622) | SQLITE_PRIVATE void sqlite3AlterBeginAddColumn(Parse *pParse, SrcList *p...
  function isRealTable (line 119705) | static int isRealTable(Parse *pParse, Table *pTab, int bDrop){
  function SQLITE_PRIVATE (line 119735) | SQLITE_PRIVATE void sqlite3AlterRenameColumn(
  type RenameToken (line 119838) | struct RenameToken {
  type RenameCtx (line 119848) | typedef struct RenameCtx RenameCtx;
  type RenameCtx (line 119849) | struct RenameCtx {
  function renameTokenCheckAll (line 119881) | static void renameTokenCheckAll(Parse *pParse, const void *pPtr){
  function SQLITE_PRIVATE (line 119912) | SQLITE_PRIVATE const void *sqlite3RenameTokenMap(
  function SQLITE_PRIVATE (line 119938) | SQLITE_PRIVATE void sqlite3RenameTokenRemap(Parse *pParse, const void *p...
  function renameUnmapExprCb (line 119952) | static int renameUnmapExprCb(Walker *pWalker, Expr *pExpr){
  function renameWalkWith (line 119965) | static void renameWalkWith(Walker *pWalker, Select *pSelect){
  function unmapColumnIdlistNames (line 120000) | static void unmapColumnIdlistNames(
  function renameUnmapSelectCb (line 120014) | static int renameUnmapSelectCb(Walker *pWalker, Select *p){
  function SQLITE_PRIVATE (line 120050) | SQLITE_PRIVATE void sqlite3RenameExprUnmap(Parse *pParse, Expr *pExpr){
  function SQLITE_PRIVATE (line 120066) | SQLITE_PRIVATE void sqlite3RenameExprlistUnmap(Parse *pParse, ExprList *...
  function renameTokenFree (line 120085) | static void renameTokenFree(sqlite3 *db, RenameToken *pToken){
  function RenameToken (line 120103) | static RenameToken *renameTokenFind(
  function renameColumnSelectCb (line 120132) | static int renameColumnSelectCb(Walker *pWalker, Select *p){
  function renameColumnExprCb (line 120151) | static int renameColumnExprCb(Walker *pWalker, Expr *pExpr){
  function RenameToken (line 120177) | static RenameToken *renameColumnTokenNext(RenameCtx *pCtx){
  function renameColumnParseError (line 120198) | static void renameColumnParseError(
  function renameColumnElistNames (line 120223) | static void renameColumnElistNames(
  function renameColumnIdlistNames (line 120248) | static void renameColumnIdlistNames(
  function renameParseSql (line 120270) | static int renameParseSql(
  function renameEditSql (line 120334) | static int renameEditSql(
  function renameSetENames (line 120441) | static void renameSetENames(ExprList *pEList, int val){
  function renameResolveTrigger (line 120458) | static int renameResolveTrigger(Parse *pParse){
  function renameWalkTrigger (line 120571) | static void renameWalkTrigger(Walker *pWalker, Trigger *pTrigger){
  function renameParseCleanup (line 120606) | static void renameParseCleanup(Parse *pParse){
  function renameColumnFunc (line 120647) | static void renameColumnFunc(
  function renameTableExprCb (line 120814) | static int renameTableExprCb(Walker *pWalker, Expr *pExpr){
  function renameTableSelectCb (line 120828) | static int renameTableSelectCb(Walker *pWalker, Select *pSelect){
  function renameTableFunc (line 120872) | static void renameTableFunc(
  function renameQuotefixExprCb (line 121024) | static int renameQuotefixExprCb(Walker *pWalker, Expr *pExpr){
  function renameQuotefixFunc (line 121058) | static void renameQuotefixFunc(
  function renameTableTest (line 121171) | static void renameTableTest(
  function dropColumnFunc (line 121246) | static void dropColumnFunc(
  function SQLITE_PRIVATE (line 121311) | SQLITE_PRIVATE void sqlite3AlterDropColumn(Parse *pParse, SrcList *pSrc,...
  function SQLITE_PRIVATE (line 121458) | SQLITE_PRIVATE void sqlite3AlterFunctions(void){
  function openStatTable (line 121637) | static void openStatTable(
  type StatAccum (line 121736) | typedef struct StatAccum StatAccum;
  type StatSample (line 121737) | typedef struct StatSample StatSample;
  type StatSample (line 121738) | struct StatSample {
  type StatAccum (line 121753) | struct StatAccum {
  function sampleClear (line 121778) | static void sampleClear(sqlite3 *db, StatSample *p){
  function sampleSetRowid (line 121790) | static void sampleSetRowid(sqlite3 *db, StatSample *p, int n, const u8 *...
  function sampleSetRowidInt64 (line 121806) | static void sampleSetRowidInt64(sqlite3 *db, StatSample *p, i64 iRowid){
  function sampleCopy (line 121819) | static void sampleCopy(StatAccum *p, StatSample *pTo, StatSample *pFrom){
  function statAccumDestructor (line 121837) | static void statAccumDestructor(void *pOld){
  function statInit (line 121872) | static void statInit(
  function sampleIsBetterPost (line 121982) | static int sampleIsBetterPost(
  function sampleIsBetter (line 122006) | static int sampleIsBetter(
  function sampleInsert (line 122029) | static void sampleInsert(StatAccum *p, StatSample *pNew, int nEqZero){
  function samplePushPrevious (line 122121) | static void samplePushPrevious(StatAccum *p, int iChng){
  function statPush (line 122173) | static void statPush(
  function statGet (line 122289) | static void statGet(
  function callStatGet (line 122406) | static void callStatGet(Parse *pParse, int regStat, int iParam, int regO...
  function analyzeVdbeCommentIndexWithColumnName (line 122423) | static void analyzeVdbeCommentIndexWithColumnName(
  function analyzeOneTable (line 122448) | static void analyzeOneTable(
  function loadAnalysis (line 122855) | static void loadAnalysis(Parse *pParse, int iDb){
  function analyzeDatabase (line 122865) | static void analyzeDatabase(Parse *pParse, int iDb){
  function analyzeTable (line 122897) | static void analyzeTable(Parse *pParse, Table *pTab, Index *pOnlyIdx){
  function SQLITE_PRIVATE (line 122928) | SQLITE_PRIVATE void sqlite3Analyze(Parse *pParse, Token *pName1, Token *...
  type analysisInfo (line 122980) | typedef struct analysisInfo analysisInfo;
  type analysisInfo (line 122981) | struct analysisInfo {
  function decodeIntArray (line 122991) | static void decodeIntArray(
  function SQLITE_PRIVATE (line 125230) | SQLITE_PRIVATE void sqlite3DeleteTable(sqlite3 *db, Table *pTable){
  function SQLITE_PRIVATE (line 125237) | SQLITE_PRIVATE void sqlite3DeleteTableGeneric(sqlite3 *db, void *pTable){
  function SQLITE_PRIVATE (line 125246) | SQLITE_PRIVATE void sqlite3UnlinkAndDeleteTable(sqlite3 *db, int iDb, co...
  function SQLITE_PRIVATE (line 125274) | SQLITE_PRIVATE char *sqlite3NameFromToken(sqlite3 *db, const Token *pName){
  function SQLITE_PRIVATE (line 125289) | SQLITE_PRIVATE void sqlite3OpenSchemaTable(Parse *p, int iDb){
  function SQLITE_PRIVATE (line 125304) | SQLITE_PRIVATE int sqlite3FindDbName(sqlite3 *db, const char *zName){
  function SQLITE_PRIVATE (line 125324) | SQLITE_PRIVATE int sqlite3FindDb(sqlite3 *db, Token *pName){
  function SQLITE_PRIVATE (line 125349) | SQLITE_PRIVATE int sqlite3TwoPartName(
  function SQLITE_PRIVATE (line 125382) | SQLITE_PRIVATE int sqlite3WritableSchema(sqlite3 *db){
  function SQLITE_PRIVATE (line 125404) | SQLITE_PRIVATE int sqlite3CheckObjectName(
  function SQLITE_PRIVATE (line 125442) | SQLITE_PRIVATE Index *sqlite3PrimaryKeyIndex(Table *pTab){
  f
Copy disabled (too large) Download .json
Condensed preview — 96 files, each showing path, character count, and a content snippet. Download the .json file for the full structured content (10,857K chars).
[
  {
    "path": ".codecov.yml",
    "chars": 52,
    "preview": "coverage:\n  status:\n    project: off\n    patch: off\n"
  },
  {
    "path": ".github/FUNDING.yml",
    "chars": 448,
    "preview": "# These are supported funding model platforms\n\ngithub: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [u"
  },
  {
    "path": ".github/workflows/cifuzz.yaml",
    "chars": 825,
    "preview": "name: CIFuzz\non: [pull_request]\njobs:\n Fuzzing:\n   runs-on: ubuntu-latest\n   strategy:\n     fail-fast: false\n     matrix"
  },
  {
    "path": ".github/workflows/docker.yaml",
    "chars": 414,
    "preview": "name: dockerfile\n\non:\n  workflow_dispatch:\n  push:\n    tags:\n      - 'v*'\n  pull_request:\n    branches: [ master ]\n\njobs"
  },
  {
    "path": ".github/workflows/go.yaml",
    "chars": 3254,
    "preview": "name: Go\n\non: [push, pull_request]\n\njobs:\n\n  test:\n    name: Test\n    runs-on: ${{ matrix.os }}\n    defaults:\n      run:"
  },
  {
    "path": ".gitignore",
    "chars": 129,
    "preview": "*.db\n*.exe\n*.dll\n*.o\n\n# VSCode\n.vscode\n\n# Exclude from upgrade\nupgrade/*.c\nupgrade/*.h\n\n# Exclude upgrade binary\nupgrade"
  },
  {
    "path": "LICENSE",
    "chars": 1085,
    "preview": "The MIT License (MIT)\n\nCopyright (c) 2014 Yasuhiro Matsumoto\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "README.md",
    "chars": 30080,
    "preview": "go-sqlite3\n==========\n\n[![Go Reference](https://pkg.go.dev/badge/github.com/mattn/go-sqlite3.svg)](https://pkg.go.dev/gi"
  },
  {
    "path": "_example/custom_driver_name/Makefile",
    "chars": 222,
    "preview": "TARGET = custom_driver_name\nifeq ($(OS),Windows_NT)\nTARGET := $(TARGET).exe\nendif\n\nall : $(TARGET)\n\n$(TARGET) : main.go\n"
  },
  {
    "path": "_example/custom_driver_name/main.go",
    "chars": 153,
    "preview": "package main\n\nimport (\n\t\"database/sql\"\n\n\t_ \"github.com/mattn/go-sqlite3\"\n)\n\nfunc main() {\n\tfor _, driver := range sql.Dr"
  },
  {
    "path": "_example/custom_func/main.go",
    "chars": 2937,
    "preview": "package main\n\nimport (\n\t\"database/sql\"\n\t\"fmt\"\n\t\"log\"\n\t\"math\"\n\t\"math/rand\"\n\n\tsqlite \"github.com/mattn/go-sqlite3\"\n)\n\n// C"
  },
  {
    "path": "_example/fuzz/fuzz_openexec.go",
    "chars": 477,
    "preview": "package sqlite3_fuzz\n\nimport (\n\t\"bytes\"\n\t\"database/sql\"\n\t\"io/ioutil\"\n\n\t_ \"github.com/mattn/go-sqlite3\"\n)\n\nfunc FuzzOpenE"
  },
  {
    "path": "_example/hook/hook.go",
    "chars": 1608,
    "preview": "package main\n\nimport (\n\t\"database/sql\"\n\t\"log\"\n\t\"os\"\n\n\t\"github.com/mattn/go-sqlite3\"\n)\n\nfunc main() {\n\tsqlite3conn := []*"
  },
  {
    "path": "_example/json/json.go",
    "chars": 2774,
    "preview": "package main\n\nimport (\n\t\"database/sql\"\n\t\"database/sql/driver\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t_ \"github.com/mattn/go-sqlite3\"\n\t"
  },
  {
    "path": "_example/limit/limit.go",
    "chars": 2644,
    "preview": "package main\n\nimport (\n\t\"database/sql\"\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n\t\"strings\"\n\n\t\"github.com/mattn/go-sqlite3\"\n)\n\nfunc createBulk"
  },
  {
    "path": "_example/mod_regexp/Makefile",
    "chars": 394,
    "preview": "ifeq ($(OS),Windows_NT)\nEXE=extension.exe\nLIB_EXT=dll\nRM=cmd /c del\nLDFLAG=\nelse\nEXE=extension\nifeq ($(shell uname -s),D"
  },
  {
    "path": "_example/mod_regexp/extension.go",
    "chars": 798,
    "preview": "package main\n\nimport (\n\t\"database/sql\"\n\t\"fmt\"\n\t\"github.com/mattn/go-sqlite3\"\n\t\"log\"\n)\n\nfunc main() {\n\tsql.Register(\"sqli"
  },
  {
    "path": "_example/mod_regexp/sqlite3_mod_regexp.c",
    "chars": 1035,
    "preview": "#include <pcre.h>\n#include <string.h>\n#include <stdio.h>\n#include <sqlite3ext.h>\n\nSQLITE_EXTENSION_INIT1\nstatic void reg"
  },
  {
    "path": "_example/mod_vtable/Makefile",
    "chars": 432,
    "preview": "ifeq ($(OS),Windows_NT)\nEXE=extension.exe\nLIB_EXT=dll\nRM=cmd /c del\nLIBCURL=-lcurldll\nLDFLAG=\nelse\nEXE=extension\nifeq ($"
  },
  {
    "path": "_example/mod_vtable/extension.go",
    "chars": 773,
    "preview": "package main\n\nimport (\n\t\"database/sql\"\n\t\"fmt\"\n\t\"log\"\n\n\t\"github.com/mattn/go-sqlite3\"\n)\n\nfunc main() {\n\tsql.Register(\"sql"
  },
  {
    "path": "_example/mod_vtable/picojson.h",
    "chars": 28028,
    "preview": "/*\n * Copyright 2009-2010 Cybozu Labs, Inc.\n * Copyright 2011 Kazuho Oku\n * \n * Redistribution and use in source and bin"
  },
  {
    "path": "_example/mod_vtable/sqlite3_mod_vtable.cc",
    "chars": 5445,
    "preview": "#include <string>\n#include <sstream>\n#include <sqlite3.h>\n#include <sqlite3ext.h>\n#include <curl/curl.h>\n#include \"picoj"
  },
  {
    "path": "_example/simple/Dockerfile",
    "chars": 1506,
    "preview": "# =============================================================================\n#  Multi-stage Dockerfile Example\n# ===="
  },
  {
    "path": "_example/simple/simple.go",
    "chars": 1848,
    "preview": "package main\n\nimport (\n\t\"database/sql\"\n\t\"fmt\"\n\t_ \"github.com/mattn/go-sqlite3\"\n\t\"log\"\n\t\"os\"\n)\n\nfunc main() {\n\tos.Remove("
  },
  {
    "path": "_example/trace/main.go",
    "chars": 6388,
    "preview": "package main\n\nimport (\n\t\"database/sql\"\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n\n\tsqlite3 \"github.com/mattn/go-sqlite3\"\n)\n\nfunc traceCallback"
  },
  {
    "path": "_example/vtable/main.go",
    "chars": 872,
    "preview": "package main\n\nimport (\n\t\"database/sql\"\n\t\"fmt\"\n\t\"log\"\n\n\t\"github.com/mattn/go-sqlite3\"\n)\n\nfunc main() {\n\tsql.Register(\"sql"
  },
  {
    "path": "_example/vtable/vtable.go",
    "chars": 2347,
    "preview": "package main\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"net/http\"\n\n\t\"github.com/mattn/go-sqlite3\"\n)\n\ntype githubRe"
  },
  {
    "path": "_example/vtable_eponymous_only/main.go",
    "chars": 599,
    "preview": "package main\n\nimport (\n\t\"database/sql\"\n\t\"fmt\"\n\t\"log\"\n\n\t\"github.com/mattn/go-sqlite3\"\n)\n\nfunc main() {\n\tsql.Register(\"sql"
  },
  {
    "path": "_example/vtable_eponymous_only/vtable.go",
    "chars": 2463,
    "preview": "package main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/mattn/go-sqlite3\"\n)\n\ntype seriesModule struct{}\n\nfunc (m *seriesModule) Epon"
  },
  {
    "path": "backup.go",
    "chars": 2218,
    "preview": "// Copyright (C) 2019 Yasuhiro Matsumoto <mattn.jp@gmail.com>.\n//\n// Use of this source code is governed by an MIT-style"
  },
  {
    "path": "backup_test.go",
    "chars": 9995,
    "preview": "// Copyright (C) 2019 Yasuhiro Matsumoto <mattn.jp@gmail.com>.\n//\n// Use of this source code is governed by an MIT-style"
  },
  {
    "path": "callback.go",
    "chars": 11771,
    "preview": "// Copyright (C) 2019 Yasuhiro Matsumoto <mattn.jp@gmail.com>.\n//\n// Use of this source code is governed by an MIT-style"
  },
  {
    "path": "callback_test.go",
    "chars": 3319,
    "preview": "// Copyright (C) 2019 Yasuhiro Matsumoto <mattn.jp@gmail.com>.\n//\n// Use of this source code is governed by an MIT-style"
  },
  {
    "path": "convert.go",
    "chars": 6815,
    "preview": "// Extracted from Go database/sql source code\n\n// Copyright 2011 The Go Authors. All rights reserved.\n// Use of this sou"
  },
  {
    "path": "doc.go",
    "chars": 3550,
    "preview": "/*\nPackage sqlite3 provides interface to SQLite3 databases.\n\nThis works as a driver for database/sql.\n\nInstallation\n\n\tgo"
  },
  {
    "path": "error.go",
    "chars": 6117,
    "preview": "// Copyright (C) 2019 Yasuhiro Matsumoto <mattn.jp@gmail.com>.\n//\n// Use of this source code is governed by an MIT-style"
  },
  {
    "path": "error_test.go",
    "chars": 6330,
    "preview": "// Copyright (C) 2019 Yasuhiro Matsumoto <mattn.jp@gmail.com>.\n//\n// Use of this source code is governed by an MIT-style"
  },
  {
    "path": "go.mod",
    "chars": 146,
    "preview": "module github.com/mattn/go-sqlite3\n\ngo 1.19\n\nretract (\n [v2.0.0+incompatible, v2.0.6+incompatible] // Accidental; no maj"
  },
  {
    "path": "go.sum",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "sqlite3-binding.c",
    "chars": 9390617,
    "preview": "#ifndef USE_LIBSQLITE3\n/******************************************************************************\n** This file is a"
  },
  {
    "path": "sqlite3-binding.h",
    "chars": 671937,
    "preview": "#ifndef USE_LIBSQLITE3\n/*\n** 2001-09-15\n**\n** The author disclaims copyright to this source code.  In place of\n** a lega"
  },
  {
    "path": "sqlite3.go",
    "chars": 68352,
    "preview": "// Copyright (C) 2019 Yasuhiro Matsumoto <mattn.jp@gmail.com>.\n// Copyright (C) 2018 G.J.R. Timmer <gjr.timmer@gmail.com"
  },
  {
    "path": "sqlite3_context.go",
    "chars": 3025,
    "preview": "// Copyright (C) 2019 Yasuhiro Matsumoto <mattn.jp@gmail.com>.\n//\n// Use of this source code is governed by an MIT-style"
  },
  {
    "path": "sqlite3_func_crypt.go",
    "chars": 3977,
    "preview": "// Copyright (C) 2018 G.J.R. Timmer <gjr.timmer@gmail.com>.\n//\n// Use of this source code is governed by an MIT-style\n//"
  },
  {
    "path": "sqlite3_func_crypt_test.go",
    "chars": 1912,
    "preview": "// Copyright (C) 2018 G.J.R. Timmer <gjr.timmer@gmail.com>.\n//\n// Use of this source code is governed by an MIT-style\n//"
  },
  {
    "path": "sqlite3_go113_test.go",
    "chars": 2519,
    "preview": "// Copyright (C) 2019 Yasuhiro Matsumoto <mattn.jp@gmail.com>.\n//\n// Use of this source code is governed by an MIT-style"
  },
  {
    "path": "sqlite3_go18.go",
    "chars": 1547,
    "preview": "// Copyright (C) 2019 Yasuhiro Matsumoto <mattn.jp@gmail.com>.\n//\n// Use of this source code is governed by an MIT-style"
  },
  {
    "path": "sqlite3_go18_test.go",
    "chars": 11938,
    "preview": "// Copyright (C) 2019 Yasuhiro Matsumoto <mattn.jp@gmail.com>.\n//\n// Use of this source code is governed by an MIT-style"
  },
  {
    "path": "sqlite3_libsqlite3.go",
    "chars": 688,
    "preview": "// Copyright (C) 2019 Yasuhiro Matsumoto <mattn.jp@gmail.com>.\n//\n// Use of this source code is governed by an MIT-style"
  },
  {
    "path": "sqlite3_load_extension.go",
    "chars": 1887,
    "preview": "// Copyright (C) 2019 Yasuhiro Matsumoto <mattn.jp@gmail.com>.\n//\n// Use of this source code is governed by an MIT-style"
  },
  {
    "path": "sqlite3_load_extension_omit.go",
    "chars": 625,
    "preview": "// Copyright (C) 2019 Yasuhiro Matsumoto <mattn.jp@gmail.com>.\n//\n// Use of this source code is governed by an MIT-style"
  },
  {
    "path": "sqlite3_load_extension_test.go",
    "chars": 1344,
    "preview": "// Copyright (C) 2019 Yasuhiro Matsumoto <mattn.jp@gmail.com>.\n//\n// Use of this source code is governed by an MIT-style"
  },
  {
    "path": "sqlite3_opt_allow_uri_authority.go",
    "chars": 402,
    "preview": "// Copyright (C) 2019 Yasuhiro Matsumoto <mattn.jp@gmail.com>.\n// Copyright (C) 2018 G.J.R. Timmer <gjr.timmer@gmail.com"
  },
  {
    "path": "sqlite3_opt_app_armor.go",
    "chars": 400,
    "preview": "// Copyright (C) 2019 Yasuhiro Matsumoto <mattn.jp@gmail.com>.\n// Copyright (C) 2018 G.J.R. Timmer <gjr.timmer@gmail.com"
  },
  {
    "path": "sqlite3_opt_column_metadata.go",
    "chars": 529,
    "preview": "//go:build sqlite_column_metadata\n// +build sqlite_column_metadata\n\npackage sqlite3\n\n/*\n#ifndef USE_LIBSQLITE3\n#cgo CFLA"
  },
  {
    "path": "sqlite3_opt_column_metadata_test.go",
    "chars": 1168,
    "preview": "//go:build sqlite_column_metadata\n// +build sqlite_column_metadata\n\npackage sqlite3\n\nimport \"testing\"\n\nfunc TestColumnTa"
  },
  {
    "path": "sqlite3_opt_foreign_keys.go",
    "chars": 391,
    "preview": "// Copyright (C) 2019 Yasuhiro Matsumoto <mattn.jp@gmail.com>.\n// Copyright (C) 2018 G.J.R. Timmer <gjr.timmer@gmail.com"
  },
  {
    "path": "sqlite3_opt_fts3_test.go",
    "chars": 3162,
    "preview": "// Copyright (C) 2019 Yasuhiro Matsumoto <mattn.jp@gmail.com>.\n//\n// Use of this source code is governed by an MIT-style"
  },
  {
    "path": "sqlite3_opt_fts5.go",
    "chars": 317,
    "preview": "// Copyright (C) 2019 Yasuhiro Matsumoto <mattn.jp@gmail.com>.\n//\n// Use of this source code is governed by an MIT-style"
  },
  {
    "path": "sqlite3_opt_icu.go",
    "chars": 588,
    "preview": "// Copyright (C) 2019 Yasuhiro Matsumoto <mattn.jp@gmail.com>.\n//\n// Use of this source code is governed by an MIT-style"
  },
  {
    "path": "sqlite3_opt_introspect.go",
    "chars": 384,
    "preview": "// Copyright (C) 2019 Yasuhiro Matsumoto <mattn.jp@gmail.com>.\n// Copyright (C) 2018 G.J.R. Timmer <gjr.timmer@gmail.com"
  },
  {
    "path": "sqlite3_opt_math_functions.go",
    "chars": 334,
    "preview": "// Copyright (C) 2022 Yasuhiro Matsumoto <mattn.jp@gmail.com>.\n//\n// Use of this source code is governed by an MIT-style"
  },
  {
    "path": "sqlite3_opt_math_functions_test.go",
    "chars": 567,
    "preview": "//go:build sqlite_math_functions\n// +build sqlite_math_functions\n\npackage sqlite3\n\nimport (\n\t\"database/sql\"\n\t\"testing\"\n)"
  },
  {
    "path": "sqlite3_opt_os_trace.go",
    "chars": 338,
    "preview": "// Copyright (C) 2022 Yasuhiro Matsumoto <mattn.jp@gmail.com>.\n//\n// Use of this source code is governed by an MIT-style"
  },
  {
    "path": "sqlite3_opt_percentile.go",
    "chars": 364,
    "preview": "// Copyright (C) 2019 Yasuhiro Matsumoto <mattn.jp@gmail.com>.\n// Copyright (C) 2018 G.J.R. Timmer <gjr.timmer@gmail.com"
  },
  {
    "path": "sqlite3_opt_preupdate.go",
    "chars": 528,
    "preview": "// Copyright (C) 2019 G.J.R. Timmer <gjr.timmer@gmail.com>.\n// Copyright (C) 2018 segment.com <friends@segment.com>\n//\n/"
  },
  {
    "path": "sqlite3_opt_preupdate_hook.go",
    "chars": 3240,
    "preview": "// Copyright (C) 2019 G.J.R. Timmer <gjr.timmer@gmail.com>.\n// Copyright (C) 2018 segment.com <friends@segment.com>\n//\n/"
  },
  {
    "path": "sqlite3_opt_preupdate_hook_test.go",
    "chars": 3298,
    "preview": "// Copyright (C) 2019 G.J.R. Timmer <gjr.timmer@gmail.com>.\n// Copyright (C) 2018 segment.com <friends@segment.com>\n//\n/"
  },
  {
    "path": "sqlite3_opt_preupdate_omit.go",
    "chars": 811,
    "preview": "// Copyright (C) 2019 G.J.R. Timmer <gjr.timmer@gmail.com>.\n// Copyright (C) 2018 segment.com <friends@segment.com>\n//\n/"
  },
  {
    "path": "sqlite3_opt_secure_delete.go",
    "chars": 386,
    "preview": "// Copyright (C) 2019 Yasuhiro Matsumoto <mattn.jp@gmail.com>.\n// Copyright (C) 2018 G.J.R. Timmer <gjr.timmer@gmail.com"
  },
  {
    "path": "sqlite3_opt_secure_delete_fast.go",
    "chars": 399,
    "preview": "// Copyright (C) 2019 Yasuhiro Matsumoto <mattn.jp@gmail.com>.\n// Copyright (C) 2018 G.J.R. Timmer <gjr.timmer@gmail.com"
  },
  {
    "path": "sqlite3_opt_serialize.go",
    "chars": 1810,
    "preview": "//go:build !libsqlite3 || sqlite_serialize\n// +build !libsqlite3 sqlite_serialize\n\npackage sqlite3\n\n/*\n#ifndef USE_LIBSQ"
  },
  {
    "path": "sqlite3_opt_serialize_omit.go",
    "chars": 555,
    "preview": "//go:build libsqlite3 && !sqlite_serialize\n// +build libsqlite3,!sqlite_serialize\n\npackage sqlite3\n\nimport (\n\t\"errors\"\n)"
  },
  {
    "path": "sqlite3_opt_serialize_test.go",
    "chars": 2819,
    "preview": "//go:build !libsqlite3 || sqlite_serialize\n// +build !libsqlite3 sqlite_serialize\n\npackage sqlite3\n\nimport (\n\t\"context\"\n"
  },
  {
    "path": "sqlite3_opt_stat4.go",
    "chars": 367,
    "preview": "// Copyright (C) 2019 Yasuhiro Matsumoto <mattn.jp@gmail.com>.\n// Copyright (C) 2018 G.J.R. Timmer <gjr.timmer@gmail.com"
  },
  {
    "path": "sqlite3_opt_unlock_notify.c",
    "chars": 1773,
    "preview": "// Copyright (C) 2018 Yasuhiro Matsumoto <mattn.jp@gmail.com>.\n//\n// Use of this source code is governed by an MIT-style"
  },
  {
    "path": "sqlite3_opt_unlock_notify.go",
    "chars": 2018,
    "preview": "// Copyright (C) 2019 Yasuhiro Matsumoto <mattn.jp@gmail.com>.\n//\n// Use of this source code is governed by an MIT-style"
  },
  {
    "path": "sqlite3_opt_unlock_notify_test.go",
    "chars": 4871,
    "preview": "// Copyright (C) 2019 Yasuhiro Matsumoto <mattn.jp@gmail.com>.\n//\n// Use of this source code is governed by an MIT-style"
  },
  {
    "path": "sqlite3_opt_userauth.go",
    "chars": 5087,
    "preview": "// Copyright (C) 2018 G.J.R. Timmer <gjr.timmer@gmail.com>.\n//\n// Use of this source code is governed by an MIT-style\n//"
  },
  {
    "path": "sqlite3_opt_userauth_omit.go",
    "chars": 4470,
    "preview": "// Copyright (C) 2018 G.J.R. Timmer <gjr.timmer@gmail.com>.\n//\n// Use of this source code is governed by an MIT-style\n//"
  },
  {
    "path": "sqlite3_opt_userauth_test.go",
    "chars": 1757,
    "preview": "// Copyright (C) 2018 G.J.R. Timmer <gjr.timmer@gmail.com>.\n//\n// Use of this source code is governed by an MIT-style\n//"
  },
  {
    "path": "sqlite3_opt_vacuum_full.go",
    "chars": 387,
    "preview": "// Copyright (C) 2019 Yasuhiro Matsumoto <mattn.jp@gmail.com>.\n// Copyright (C) 2018 G.J.R. Timmer <gjr.timmer@gmail.com"
  },
  {
    "path": "sqlite3_opt_vacuum_incr.go",
    "chars": 387,
    "preview": "// Copyright (C) 2019 Yasuhiro Matsumoto <mattn.jp@gmail.com>.\n// Copyright (C) 2018 G.J.R. Timmer <gjr.timmer@gmail.com"
  },
  {
    "path": "sqlite3_opt_vtable.go",
    "chars": 20734,
    "preview": "// Copyright (C) 2019 Yasuhiro Matsumoto <mattn.jp@gmail.com>.\n//\n// Use of this source code is governed by an MIT-style"
  },
  {
    "path": "sqlite3_opt_vtable_test.go",
    "chars": 14000,
    "preview": "// Copyright (C) 2019 Yasuhiro Matsumoto <mattn.jp@gmail.com>.\n//\n// Use of this source code is governed by an MIT-style"
  },
  {
    "path": "sqlite3_other.go",
    "chars": 396,
    "preview": "// Copyright (C) 2019 Yasuhiro Matsumoto <mattn.jp@gmail.com>.\n//\n// Use of this source code is governed by an MIT-style"
  },
  {
    "path": "sqlite3_solaris.go",
    "chars": 294,
    "preview": "// Copyright (C) 2019 Yasuhiro Matsumoto <mattn.jp@gmail.com>.\n//\n// Use of this source code is governed by an MIT-style"
  },
  {
    "path": "sqlite3_test.go",
    "chars": 65852,
    "preview": "// Copyright (C) 2019 Yasuhiro Matsumoto <mattn.jp@gmail.com>.\n//\n// Use of this source code is governed by an MIT-style"
  },
  {
    "path": "sqlite3_trace.go",
    "chars": 8370,
    "preview": "// Copyright (C) 2019 Yasuhiro Matsumoto <mattn.jp@gmail.com>.\n//\n// Use of this source code is governed by an MIT-style"
  },
  {
    "path": "sqlite3_type.go",
    "chars": 2447,
    "preview": "// Copyright (C) 2019 Yasuhiro Matsumoto <mattn.jp@gmail.com>.\n// Use of this source code is governed by an MIT-style\n//"
  },
  {
    "path": "sqlite3_usleep_windows.go",
    "chars": 1253,
    "preview": "// Copyright (C) 2018 G.J.R. Timmer <gjr.timmer@gmail.com>.\n//\n// Use of this source code is governed by an MIT-style\n//"
  },
  {
    "path": "sqlite3_windows.go",
    "chars": 404,
    "preview": "// Copyright (C) 2019 Yasuhiro Matsumoto <mattn.jp@gmail.com>.\n//\n// Use of this source code is governed by an MIT-style"
  },
  {
    "path": "sqlite3ext.h",
    "chars": 38852,
    "preview": "#ifndef USE_LIBSQLITE3\n/*\n** 2006 June 7\n**\n** The author disclaims copyright to this source code.  In place of\n** a leg"
  },
  {
    "path": "static_mock.go",
    "chars": 1308,
    "preview": "// Copyright (C) 2019 Yasuhiro Matsumoto <mattn.jp@gmail.com>.\n//\n// Use of this source code is governed by an MIT-style"
  },
  {
    "path": "upgrade/upgrade.go",
    "chars": 5124,
    "preview": "//go:build !cgo && upgrade && ignore\n// +build !cgo,upgrade,ignore\n\npackage main\n\nimport (\n\t\"archive/zip\"\n\t\"bufio\"\n\t\"byt"
  },
  {
    "path": "upgrade/upgrade.sh",
    "chars": 1122,
    "preview": "#!/bin/sh\n\nset -e\n\ncd \"$(dirname \"$0\")/..\"\n\nCURRENT_VERSION=$(grep '#define SQLITE_VERSION_NUMBER' sqlite3-binding.c | g"
  }
]

About this extraction

This page contains the full source code of the mattn/go-sqlite3 GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 96 files (10.0 MB), approximately 2.6M tokens, and a symbol index with 5789 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!