Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/conneroisu/dbpu
Golang database per user for turso.
https://github.com/conneroisu/dbpu
Last synced: 22 days ago
JSON representation
Golang database per user for turso.
- Host: GitHub
- URL: https://github.com/conneroisu/dbpu
- Owner: conneroisu
- License: mit
- Created: 2024-02-27T19:41:47.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-09-09T19:17:52.000Z (3 months ago)
- Last Synced: 2024-11-03T01:33:26.908Z (about 1 month ago)
- Language: Go
- Homepage:
- Size: 369 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
- awesome-turso - dbpu
README
# go-dbpu
Golang database per user for turso db.
## Installation
```bash
go get github.com/conneroisu/dbpu
```## Usage
See examples for more details.
### Create a new database
The following example creates a new database.
```go
// func CreateDatabase(orgToken string, orgName string, name string, group string) (Db, error) {
package mainimport (
"fmt"
"os"
"github.com/conneroisu/dbpu"
"github.com/google/uuid"
)func main() {
orgToken := os.Getenv("ORG_TOKEN")
orgName := os.Getenv("ORG_NAME")
dbName := uuid.New().String()
db, err := dbpu.CreateDatabase(orgToken, orgName, dbName, "default")
if err != nil {
fmt.Println(err)
}
fmt.Println(db)
}
```