Skip to content

Commit

Permalink
Merge branch 'main' into pr/flowchartsman/86
Browse files Browse the repository at this point in the history
  • Loading branch information
zombiezen committed Aug 16, 2024
2 parents 67322b6 + 26b464f commit 4c9b124
Show file tree
Hide file tree
Showing 77 changed files with 525 additions and 228 deletions.
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2021 Ross Light
# Copyright 2021 Roxy Light
# SPDX-License-Identifier: ISC

version: 2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2021 Ross Light
# Copyright 2021 Roxy Light
# SPDX-License-Identifier: ISC

name: Build
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2021 Ross Light
# Copyright 2021 Roxy Light
# SPDX-License-Identifier: ISC

name: Publish
Expand Down
2 changes: 1 addition & 1 deletion .vscode/copyright.code-snippets
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"Copyright": {
"prefix": "copyright",
"body": [
"$LINE_COMMENT Copyright $CURRENT_YEAR Ross Light",
"$LINE_COMMENT Copyright $CURRENT_YEAR Roxy Light",
"$LINE_COMMENT SPDX-License-Identifier: ISC",
],
"description": "Copyright header"
Expand Down
63 changes: 62 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,68 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

[Unreleased]: https://github.com/zombiezen/go-sqlite/compare/v1.1.2...main
[Unreleased]: https://github.com/zombiezen/go-sqlite/compare/v1.3.0...main

## [Unreleased][]

### Changed

- `Conn.Close` returns an error if the connection has already been closed
([#101](https://github.com/zombiezen/go-sqlite/issues/101)).

## [1.3.0][] - 2024-05-04

Version 1.3 is largely a bug-fix release,
but is a minor version change because of the new `sqlitemigration.Pool.Take` method.

### Added

- `sqlitemigration.Pool` now has a new method `Take`
so that it implements a common interface with `sqlitex.Pool`
([#97](https://github.com/zombiezen/go-sqlite/pull/97)).
- Documented `OpenWAL` behavior on `sqlite.OpenConn`.

### Fixed

- Address low-frequency errors with concurrent use of `sqlitemigration`
([#99](https://github.com/zombiezen/go-sqlite/issues/99)).
- The error returned from `sqlitex.NewPool`
when trying to open an in-memory database
now gives correct advice
([#92](https://github.com/zombiezen/go-sqlite/issues/92)).

## [1.2.0][] - 2024-03-27

Version 1.2.0 adds a `sqlitex.Pool.Take` method
and improves error messages.

[1.2.0]: https://github.com/zombiezen/go-sqlite/releases/tag/v1.2.0

### Added

- `sqlitex.Pool` has a new method `Take`
which returns an `error` along with a `Conn`
([#83](https://github.com/zombiezen/go-sqlite/issues/83)).
- `sqlite.ErrorOffset` is a new function
that returns the SQL byte offset that an error references.

### Changed

- `sqlite.Conn.Prep`, `sqlite.Conn.Prepare`, and `sqlite.Conn.PrepareTransient`
now include position information in error messages if available.
- Many error messages around statement execution changed their format
for better readability.
Error messages are not stable API and should not be depended on.

### Deprecated

- The `sqlitex.Pool.Get` method has been deprecated
in favor of the new `Take` method.

### Fixed

- Error messages no longer duplicate information from their error code
(reported in [#84](https://github.com/zombiezen/go-sqlite/issues/84)).

## [1.1.2][] - 2024-02-14

Expand Down
2 changes: 1 addition & 1 deletion CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ representative at an online or offline event.
## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at ross@zombiezen.com.
reported to the community leaders responsible for enforcement at roxy@zombiezen.com.
All complaints will be reviewed and investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of the
Expand Down
20 changes: 14 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
# `zombiezen.com/go/sqlite` Contributor's Guide

`zombiezen.com/go/sqlite` is mostly a project to fill my own needs, but is
open source in the interest of availability and reuse. I am open to accepting
bug fixes, but generally not larger changes or features. If in doubt, ask me.
`zombiezen.com/go/sqlite` is [@zombiezen's][zombiezen] labor of love
in providing a pleasant, performant, and powerful Go binding to SQLite.
The design philosophy of `zombiezen.com/go/sqlite`
is to be a direct binding to SQLite as much as possible
while adapting the API to use Go idioms.

File a bug on the [issue tracker][] or [open a pull request][]. Please follow
the [Code of Conduct][] for all interactions. If applicable, add unit tests for
your change before sending out for review.
@zombiezen is open to accepting bug fixes,
but generally not larger changes or features.
If in doubt, ask them.
And remember, [a "no" is temporary, a "yes" is forever.](https://opensource.guide/best-practices/)

File a bug on the [issue tracker][] or [open a pull request][].
Please follow the [Code of Conduct][] for all interactions.
If applicable, add unit tests for your change before sending out for review.

[Code of Conduct]: CODE_OF_CONDUCT.md
[issue tracker]: https://github.com/zombiezen/go-sqlite/issues/new
[open a pull request]: https://github.com/zombiezen/go-sqlite/compare
[zombiezen]: https://github.com/zombiezen
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Copyright (c) 2018 David Crawshaw <[email protected]>
Copyright (c) 2021 Ross Light <ross@zombiezen.com>
Copyright (c) 2021 Roxy Light <roxy@zombiezen.com>

Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the above
Expand Down
2 changes: 1 addition & 1 deletion auth.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2021 Ross Light
// Copyright 2021 Roxy Light
// SPDX-License-Identifier: ISC

package sqlite
Expand Down
2 changes: 1 addition & 1 deletion auth_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2021 Ross Light
// Copyright 2021 Roxy Light
// SPDX-License-Identifier: ISC

package sqlite_test
Expand Down
2 changes: 1 addition & 1 deletion backup.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2023 Ross Light
// Copyright 2023 Roxy Light
// SPDX-License-Identifier: ISC

package sqlite
Expand Down
2 changes: 1 addition & 1 deletion backup_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2023 Ross Light
// Copyright 2023 Roxy Light
// SPDX-License-Identifier: ISC

package sqlite_test
Expand Down
2 changes: 1 addition & 1 deletion blob.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) 2018 David Crawshaw <[email protected]>
// Copyright (c) 2021 Ross Light <ross@zombiezen.com>
// Copyright (c) 2021 Roxy Light <roxy@zombiezen.com>
//
// Permission to use, copy, modify, and distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
Expand Down
2 changes: 1 addition & 1 deletion blob_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) 2018 David Crawshaw <[email protected]>
// Copyright (c) 2021 Ross Light <ross@zombiezen.com>
// Copyright (c) 2021 Roxy Light <roxy@zombiezen.com>
//
// Permission to use, copy, modify, and distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
Expand Down
2 changes: 1 addition & 1 deletion blocking_step.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) 2018 David Crawshaw <[email protected]>
// Copyright (c) 2021 Ross Light <ross@zombiezen.com>
// Copyright (c) 2021 Roxy Light <roxy@zombiezen.com>
//
// Permission to use, copy, modify, and distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
Expand Down
2 changes: 1 addition & 1 deletion cmd/zombiezen-sqlite-migrate/migrate.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2021 Ross Light
// Copyright 2021 Roxy Light
// SPDX-License-Identifier: ISC

package main
Expand Down
2 changes: 1 addition & 1 deletion cmd/zombiezen-sqlite-migrate/migrate_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2021 Ross Light
// Copyright 2021 Roxy Light
// SPDX-License-Identifier: ISC

package main
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2021 Ross Light
// Copyright 2021 Roxy Light
// SPDX-License-Identifier: ISC

package main
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2021 Ross Light
// Copyright 2021 Roxy Light
// SPDX-License-Identifier: ISC

package main
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2021 Ross Light
// Copyright 2021 Roxy Light
// SPDX-License-Identifier: ISC

package main
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2021 Ross Light
// Copyright 2021 Roxy Light
// SPDX-License-Identifier: ISC

package main
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2021 Ross Light
// Copyright 2021 Roxy Light
// SPDX-License-Identifier: ISC

package main
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2021 Ross Light
// Copyright 2021 Roxy Light
// SPDX-License-Identifier: ISC

package main
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2021 Ross Light
// Copyright 2021 Roxy Light
// SPDX-License-Identifier: ISC

package main
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2021 Ross Light
// Copyright 2021 Roxy Light
// SPDX-License-Identifier: ISC

package main
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2021 Ross Light
// Copyright 2021 Roxy Light
// SPDX-License-Identifier: ISC

package main
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2021 Ross Light
// Copyright 2021 Roxy Light
// SPDX-License-Identifier: ISC

package main
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2021 Ross Light
// Copyright 2021 Roxy Light
// SPDX-License-Identifier: ISC

package main
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2021 Ross Light
// Copyright 2021 Roxy Light
// SPDX-License-Identifier: ISC

package main
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2021 Ross Light
// Copyright 2021 Roxy Light
// SPDX-License-Identifier: ISC

package main
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2021 Ross Light
// Copyright 2021 Roxy Light
// SPDX-License-Identifier: ISC

package main
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2021 Ross Light
// Copyright 2021 Roxy Light
// SPDX-License-Identifier: ISC

// Test stubs for crawshaw.io/sqlite/sqlitex.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2021 Ross Light
// Copyright 2021 Roxy Light
// SPDX-License-Identifier: ISC

// Test stubs for crawshaw.io/sqlite.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2021 Ross Light
// Copyright 2021 Roxy Light
// SPDX-License-Identifier: ISC

// Test stubs for zombiezen.com/go/bass/sql/sqlitefile.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2021 Ross Light
// Copyright 2021 Roxy Light
// SPDX-License-Identifier: ISC

// Test stubs for zombiezen.com/go/sqlite/sqlitex.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2021 Ross Light
// Copyright 2021 Roxy Light
// SPDX-License-Identifier: ISC

// Test stubs for zombiezen.com/go/sqlite.
Expand Down
2 changes: 1 addition & 1 deletion doc.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) 2018 David Crawshaw <[email protected]>
// Copyright (c) 2021 Ross Light <ross@zombiezen.com>
// Copyright (c) 2021 Roxy Light <roxy@zombiezen.com>
//
// Permission to use, copy, modify, and distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
Expand Down
2 changes: 1 addition & 1 deletion example_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2021 Ross Light
// Copyright 2021 Roxy Light
// SPDX-License-Identifier: ISC

package sqlite_test
Expand Down
2 changes: 1 addition & 1 deletion export_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) 2018 David Crawshaw <[email protected]>
// Copyright (c) 2021 Ross Light <ross@zombiezen.com>
// Copyright (c) 2021 Roxy Light <roxy@zombiezen.com>
//
// Permission to use, copy, modify, and distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
Expand Down
2 changes: 1 addition & 1 deletion ext/generateseries/example_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2023 Ross Light
// Copyright 2023 Roxy Light
// SPDX-License-Identifier: ISC

package generateseries_test
Expand Down
2 changes: 1 addition & 1 deletion ext/generateseries/generateseries.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2023 Ross Light
// Copyright 2023 Roxy Light
// SPDX-License-Identifier: ISC

// Package generateseries provides a port of the [generate_series] table-valued function
Expand Down
2 changes: 1 addition & 1 deletion ext/refunc/refunc.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2023 Ross Light
// Copyright 2023 Roxy Light
// SPDX-License-Identifier: ISC

// Package refunc provides an implementation of the [REGEXP operator]
Expand Down
2 changes: 1 addition & 1 deletion ext/refunc/refunc_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2023 Ross Light
// Copyright 2023 Roxy Light
// SPDX-License-Identifier: ISC

package refunc
Expand Down
2 changes: 1 addition & 1 deletion func.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) 2018 David Crawshaw <[email protected]>
// Copyright (c) 2021 Ross Light <ross@zombiezen.com>
// Copyright (c) 2021 Roxy Light <roxy@zombiezen.com>
//
// Permission to use, copy, modify, and distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
Expand Down
2 changes: 1 addition & 1 deletion func_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) 2018 David Crawshaw <[email protected]>
// Copyright (c) 2021 Ross Light <ross@zombiezen.com>
// Copyright (c) 2021 Roxy Light <roxy@zombiezen.com>
//
// Permission to use, copy, modify, and distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
Expand Down
8 changes: 5 additions & 3 deletions http_example_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2021 Ross Light
// Copyright 2021 Roxy Light
// SPDX-License-Identifier: ISC

package sqlite_test
Expand Down Expand Up @@ -27,11 +27,13 @@ func Example_http() {
}

func handle(w http.ResponseWriter, r *http.Request) {
conn := dbpool.Get(r.Context())
if conn == nil {
conn, err := dbpool.Take(r.Context())
if err != nil {
http.Error(w, err.Error(), http.StatusServiceUnavailable)
return
}
defer dbpool.Put(conn)

stmt := conn.Prep("SELECT foo FROM footable WHERE id = $id;")
stmt.SetText("$id", "_user_id_")
for {
Expand Down
2 changes: 1 addition & 1 deletion index_constraint.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2023 Ross Light
// Copyright 2023 Roxy Light
// SPDX-License-Identifier: ISC

package sqlite
Expand Down
Loading

0 comments on commit 4c9b124

Please sign in to comment.