登录 注册

go-sqlite3

去点 Star
数据分析与数据处理图像、视频与音频
9,277
Stars
0
Forks
0
Watchers
0
Open Issues
未知
许可证
C
语言
创建时间
最近更新

项目能做什么

基于 database/sql 的 Go 语言 sqlite3 驱动。
来源:AI 基于仓库事实生成 · 内容以仓库实际 README 为准

使用说明 查看原始 README 原仓库文档

中文使用说明暂未生成。下面保留原仓库 README 摘录,命令与配置均以原文为准。
原始 README 摘录(英文原文,节选前 3000 字符)
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)

## Sponsors

This project is proudly sponsored by:

<a href="https://coderabbit.link/mattn">
  <picture>
    <source media="(prefers-color-scheme: dark)" srcset="https://victorious-bubble-f69a016683.media.strapiapp.com/White_Typemark_79b9189d19.svg">
    <img src="https://victorious-bubble-f69a016683.media.strapiapp.com/Orange_Typemark_43bf516c9d.svg" alt="CodeRabbit" width="320">
  </picture>
</a>

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

# 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
阅读完整原文

商业机会分析 AI 生成

CGO 跨平台编译与构建优化工具链(CLI / Actions)

产品构想解决 go-sqlite3 强依赖 CGO (`CGO_ENABLED=1` + gcc) 导致的跨平台(ARM/Windows/macOS/Musl/Alpine)编译痛点,提供即开即用的容器化构建矩阵与预编译缓存解决方案。
核心功能一键多架构交叉编译 CLI、针对 Alpine/Musl 的静态链接优化、Docker 构建加速缓存、针对 Windows/macOS 代码签名的集成流水线。
目标用户受困于 CI/CD 耗时与交叉编译失败的 Go 开发团队及客户端开发者。
难度/周期中等 · 1-2 个月 · 成本:极低(主要是 CI 资源和测试机器成本)
收费模式免费开源基础 Action,私有镜像仓库/企业定制构建工具链与技术支持收费。
竞争风险部分开发者可能直接转向纯 Go 重写版(如 `modernc.org/sqlite`)以规避 CGO,压缩市场空间。
依据 已验证事实(README 显式标注必须开启 CGO 并列出大量编译问题与平台说明)

Go + SQLite 并发诊断与锁监控中间件(SDK + UI)

产品构想针对 Go `database/sql` 连接池特性与 SQLite 单写者机制冲突引起的 `database is locked` 常见事故,提供专门的驱动包装层与可视化调优诊断面板。
核心功能连接池与锁等待状态实时探针、慢查询与长事务追踪、锁争用回溯与死锁告警、连接参数(WAL、busy_timeout)调优建议生成。
目标用户在生产或高并发测试环境中使用 SQLite 的 Go 后端研发团队。
难度/周期中等 · 2-3 个月 · 成本:低(基础云主机用于测试和演示)
收费模式开源核心收集 SDK,商业版控制台(历史监控、告警通知、自动优化建议)按实例/月订阅收费。
竞争风险SQLite 通常被视为轻量解决方案,遇到并发瓶颈时团队可能倾向于直接升级至 PostgreSQL 而非购买调优工具。
依据 数据支持的判断(Go 并发模型与 SQLite 文件锁机制在社区中有持续广泛的讨论和踩坑痛点)

桌面端/边缘端商业增强套件(加密 + 实时流备份)

产品构想基于 go-sqlite3 提供封装好的企业级透明数据加密(如 SQLCipher 集成)及零停机云端增量备份(同步到 S3/R2)插件模块,服务于桌面端商业软件与边缘网关。
核心功能开箱即用的透明数据库加密(AES-256)、轻量级后台增量快照上传、数据损毁自动恢复与完整性校验、防篡改审计日志导出。
目标用户桌面应用商业开发者、医疗/零售等本地合规要求高的边缘系统开发商。
难度/周期较高 · 3-4 个月 · 成本:低
收费模式商业闭源分发许可证(按应用或设备分发授权收费)。
竞争风险存在开源竞品(如 Litestream)及开源加密方案,需要做出显著的易用性和合规性差异化。
依据 已验证事实(README 中存在 User Authentication 与扩展机制相关章节,证明扩展安全性是开发者诉求)
AI 基于仓库公开数据分析生成,含推测成分,不构成收益承诺。
报告会保存到 个人中心

竞品与相似项目 GitHub Search 真实检索

项目中文简介Stars语言
vuejs/vue 中文介绍暂未生成
This is the repo for Vue 2. For Vue 3, go to https://github.
212,534 TypeScript
avelino/awesome-go 中文介绍暂未生成
A curated list of awesome Go frameworks, libraries and softw
193,327 Go
ollama/ollama 中文介绍暂未生成
Get up and running with Kimi, GLM, MiniMax, DeepSeek, gpt-os
186,675 Go
golang/go 中文介绍暂未生成
The Go programming language
139,839 Go
krahets/hello-algo 中文介绍暂未生成
《Hello 算法》:动画图解、一键运行的数据结构与算法教程。支持简中、繁中、English、日本語,提供 Python
132,216 Python
kubernetes/kubernetes 中文介绍暂未生成
Production-Grade Container Scheduling and Management
128,990 Go
以上为通过 GitHub 官方 Search API 检索的相似项目,功能差异与优劣势需进一步人工确认,配置 AI 后可生成对比分析。

项目优势与风险

技术成熟度创建于 ,最近推送 ,发布过 10 个 Release
社区活跃Star 9,277 / Fork 0 / Issue 0(数据支持,可自行核实)
许可证未检测到(需人工确认)
主要风险上游项目方向可能变化;同赛道竞争者较多(见竞品表);热度与需求不完全等价

安装与使用

快速开始(以仓库 README 为准)
git clone https://github.com/mattn/go-sqlite3.git
cd go-sqlite3
# 请阅读仓库 README 获取确切安装步骤(依赖、配置、启动命令)
阅读原仓库文档
术语说明:Docker=应用容器(把程序和依赖打包运行);API Key=调用外部服务的密钥;Git Clone=把仓库代码下载到本地。常见错误:API Key 未配置 / 端口占用 / 数据库连接失败,多数项目在 README 的 Troubleshooting 章节有说明。