Hacker GitHub

← All repos

mattn/go-sqlite3

View on GitHub ↗ ★ 9,266 C

sqlite3 driver for go using database/sql

43 mentions on Hacker News by 39 people: 1 story, 42 comments · first 2012-09-10 · latest 2026-01-23

Mentions per year 43 mentions · busiest year 2023 (7)
20082026
  1. …and the reliance of CGO which is what puts me off using Turso Edit: Looking at the go mod file I noticed github.com/mattn/go-sqlite3 which I think is a C wrapper library so I'm assuming you rely on CGO for compiling
  2. Just this month, I've learned the hard way that some file systems do not play well with mmap: https://github.com/mattn/go-sqlite3/issues/1355 In my case, it seems that Mac's ExFAT driver is incompatible with sqlite's WAL mode because the…
  3. …v0.7.0 github.com/charmbracelet/lipgloss v1.1.0 github.com/charmbracelet/log v0.4.2 github.com/mattn/go-sqlite3 v1.14.22 github.com/spf13/cobra v1.10.1 )
  4. I don't if it's the reason but the performance of modernc.org/sqlite is worse than github.com/mattn/go-sqlite3
    comment by starquake · 2025-08-12 · in Syncthing 2.0 Released
  5. …considering that seems to be the direction things are moving in. I don't understand why they chose to use github.com/mattn/go-sqlite3 instead of modernc.org/sqlite
    comment by acheong08 · 2025-08-12 · in Syncthing 2.0 Released
  6. …...) note that compiling PocketBase with `CGO_ENABLED=1` is no longer enough to kick in the github.com/mattn/go-sqlite3 driver and you need to enable it manually as shown in the db_cgo.go in our benchmarks OR like in…
  7. …) note that compiling PocketBase with `CGO_ENABLED=1` is no longer enough to kick in the github.com/mattn/go-sqlite3 driver and you need to enable it manually as shown in the db_cgo.go in our benchmarks OR like in https://pocketbase.io/doc
  8. I have not tried that. Will PGO work with CGO external libraries? I'm using https://github.com/mattn/go-sqlite3
  9. ▲ 99
    Show HN: Roast my SQLite encryption at-rest
    story by ncruces · 2024-04-30 · 50 comments
  10. for what it's worth, the two pool approach is suggested here by a collaborator to github.com/mattn/go-sqlite3: https://github.com/mattn/go-sqlite3/issues/1179#issuecomment...
    comment by acrispino · 2024-04-15 · in Redis re-implemented with SQLite
  11. …Make sure to use a unique filename as the `file:` value, especially if using this in tests. [1]: https://github.com/mattn/go-sqlite3#faq
  12. …(and I appreciate him for that stance, and for taking on the maintenance burden it brings). e.g., https://github.com/mattn/go-sqlite3/pull/1042#issuecomment-1...
  13. Go has both. The CGO-bindings are preferable, generally. It’s very mature, fast and works great. https://github.com/mattn/go-sqlite3
  14. …interface to incremental blob IO have been left unaddressed. https://www.sqlite.org/bindptr.html https://github.com/mattn/go-sqlite3/issues/239
    comment by ncruces · 2023-12-14 · in I benchmarked six Go SQLite drivers
  15. …strict tables is that since sqlite does not (yet?) have a dedicated type for timestamps, a driver like github.com/mattn/go-sqlite3 use the typename in the schema to determine when a column can be converted to a native time datatype. But…
    comment by skissane · 2023-11-16 · in The Design of SQLite4 (2014)
  16. …strict tables is that since sqlite does not (yet?) have a dedicated type for timestamps, a driver like github.com/mattn/go-sqlite3 use the typename in the schema to determine when a column can be converted to a native time datatype. But…
    comment by acrispino · 2023-11-16 · in The Design of SQLite4 (2014)
  17. …now. Btw, bundling a C compiler is also much harder when you don't build on top of LLVM. [1] https://github.com/mattn/go-sqlite3/issues/1164
  18. https://github.com/mattn/go-sqlite3/blob/master/_example/sim... notice that the SQLite package isn't used directly, its only imported to handle the database behind the scenes. all the actual code is written using only the standard library
  19. …The widely used Go SQLite library by mattn says it supports it, if that's useful: https://github.com/mattn/go-sqlite3#user-authentication
    comment by justinclift · 2023-04-29 · in Exciting SQLite Improvements Since 2020
  20. …the current system makes "typo-squatting attacks" harder to do. Consider the popular golang package github.com/mattn/go-sqlite3. The only way to "typosquat" the package is to typosquat somewhere up the dependency tree; e.g., by creating…
  21. …rewrite my framework for limited data types and the doubts regarding concurrency keeps me away. [1] https://github.com/mattn/go-sqlite3
    comment by Abishek_Muthian · 2022-09-08 · in How the SQLite virtual machine works
  22. The default go sqlite driver is https://github.com/mattn/go-sqlite3 , which is quite lovely, but I ran into issues with concurrency on read only databases. I'm now using https://github.com/crawshaw/sqlite and it seems to address those…
    comment by pstuart · 2022-05-13 · in SQLite in Go, with and Without Cgo
  23. …have some experience with Go. Join discord.multiprocess.io, go to the #dev channel and say hi! [0] https://github.com/mattn/go-sqlite3/pull/1019 [1] https://github.com/mapbox/node-sqlite3/pull/1550 [2]…
  24. Sorry, forgot to comment: SQLite is currently 3.38.0, see https://github.com/mattn/go-sqlite3/blob/master/sqlite3-bind... I don't package it directly, but via the go bindings by mattn (go-sqlite3).
    comment by mano78 · 2022-03-12 · in Ws4sqlite: Query SQLite via HTTP
  25. …to support it and tested the new JSON syntax support in DataStation. This is fantastic! https://github.com/mattn/go-sqlite3/pull/1019
    comment by eatonphil · 2022-02-23 · in SQLite 3.38 Released
  26. I just tried it now (a year later), same compiler error (using msys2): # github.com/mattn/go-sqlite3 /usr/lib/gcc/x86_64-pc-msys/10.2.0/../../../../x86_64-pc-msys/bin/ld: cannot find -lmingwex /usr/lib/gcc/x86_64-pc-msys/10.2.0/../../../../…
    comment by marcus_cemes · 2022-02-04 · in Go performance from version 1.2 to 1.18
  27. Using https://github.com/mattn/go-sqlite3 for a pet project right now. So far not a single issue with it, I never had to think about any CGO specifics.
    comment by usrbinbash · 2021-12-29 · in Consider SQLite
  28. I admit I only used sqlite through the go driver ( https://github.com/mattn/go-sqlite3 ) where using fts5 amounts to one flag during the compile phase.
  29. With sqlite3 package and Go this doesn’t look possible, or at least not easy. https://github.com/mattn/go-sqlite3/issues/212#issuecomment-...
  30. …CGO_ENABLED=0? If that’s the case then I’m really interested. Last I checked it’s not supported[1] https://github.com/mattn/go-sqlite3/issues/384#issuecomment-...
  31. …the issues there, but jumping through hoops per platform (e.g. can't use a popular lib like https://github.com/mattn/go-sqlite3 on Windows without a MinGW gcc installation) is worth noting when touting the cross platform ease of use. Langs…
    comment by kodablah · 2018-05-26 · in Go Is a Shop-built Jig (2014)
  32. …popular, mainstream packages) where the package name is not the repo name. The one that comes to mind is github.com/mattn/go-sqlite3 which provides the `sqlite3` package.
    comment by weberc2 · 2017-08-05 · in Porting 4.5K lines of C to Go
  33. For those who don't want to wait for this to be completed, there is already https://github.com/mattn/go-sqlite3
    comment by Safety1stClyde · 2017-04-21 · in Go: package sqlite
  34. …but wanted to try this out. I installed go 1.8, and then issued the prescribed command line. It tells me `# github.com/mattn/go-sqlite3 exec: "gcc": executable file not found in %PATH%`. This looks like a rabbit hole of unknown depth that…
  35. …there. Only problem is that some things do not work properly yet (because still beta). For example `go get github.com/mattn/go-sqlite3` will not work because of some ?gcc? compilation issue. But it's getting fixed on next release.
  36. For the record: https://github.com/mattn/go-sqlite3
  37. …or 1.7 within a year. Regarding go on Windows, I'm hoping to see go-sqlite3 issue #272 resolved: https://github.com/mattn/go-sqlite3/issues/272 And go issue #14397 cmd/link, runtime: panic "invalid spdelta" with -ldflags="-linkmode…
    comment by montyedwards · 2016-04-03 · in Go 1.7 toolchain improvements
  38. …hit your meaning of "recent versions". It was certainly recent and easy enough for my needs :) [1] https://github.com/mattn/go-sqlite3 [2] http://win-builds.org/
    comment by xrstf · 2016-04-02 · in Go 1.7 toolchain improvements
  39. …For an example of what this looks like in actual use, see the very popular go-sqlite3 library: https://github.com/mattn/go-sqlite3/blob/dee1a37fe11067e9797... I personally think that large block-comments of code that actually do something,…
    comment by TheDong · 2015-05-11 · in Go Lang: Comments Are Not Directives
  40. Note that using a sqlite wrapper like https://github.com/mattn/go-sqlite3 , you also don't have any external dependencies and your application still ships as a single binary. However, there are other advantages of a Go-native storage…
  41. …I use make for this: GOPATH := ${GOPATH}:${PWD} all: always always: @go build -v myprogram deps: go get github.com/mattn/go-sqlite3 go get code.google.com/p/gorilla/context go get code.google.com/p/gorilla/mux fmt: go fmt package1 package2…
    comment by papaf · 2013-03-26 · in Introduction to Go 1.1
  42. …I need to fix the command line to download all dependencies first. You can fix it manually with: go get github.com/mattn/go-sqlite3 Also, I believe that the go command line figures out the dependencies for you, so this should get…
  43. …/usr/local/Cellar/go/1.0.2/src/pkg/github.com/robfig/revel/samples/booking/app/controllers/db.go:6): import "github.com/mattn/go-sqlite3": cannot find package