turso

package module
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 26, 2026 License: MIT Imports: 4 Imported by: 0

README

简介

现在 SQLite 的替代 Turso Database 支持多写, 不用另外加个 postgres 来应对 PocketBase 里的多写需求了

示例

请查看 pb_test.go

或者 godoc 文档: https://pkg.go.dev/github.com/shynome/pb-turso#example-DBConnect

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func DBConnect

func DBConnect(dbPath string) (*dbx.DB, error)
Example
package main

import (
	"github.com/pocketbase/pocketbase"
	turso "github.com/shynome/pb-turso"
)

func main() {
	cfg := pocketbase.Config{
		DBConnect: turso.DBConnect,
	}
	app := pocketbase.NewWithConfig(cfg)
	if err := app.Bootstrap(); err != nil {
		panic(err)
	}

	// required!
	// required!
	// required!
	turso.EnableConcurrentWrites(app, cfg)

	if err := app.Start(); err != nil {
		panic(err)
	}
}

func EnableConcurrentWrites

func EnableConcurrentWrites(app core.App, config pocketbase.Config)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL