Installation
Requirements
- Go 1.21 or higher
- A supported database (PostgreSQL or MySQL)
Install go-lightning
go get github.com/tracewayapp/go-lightning/litDatabase Drivers
go-lightning works with standard database/sql drivers. Install the driver for your database:
PostgreSQL
# pgx (recommended)
go get github.com/jackc/pgx/v5/stdlib
# or pq
go get github.com/lib/pqMySQL
go get github.com/go-sql-driver/mysqlVerify Installation
Create a simple program to verify everything is working:
package main
import (
"fmt"
"github.com/tracewayapp/go-lightning/lit"
)
type User struct {
Id int
Name string
Email string
}
func main() {
lit.RegisterModel[User](lit.PostgreSQL)
fmt.Println("go-lightning installed successfully!")
}Run it:
go run main.goIf you see "go-lightning installed successfully!", you're ready to proceed to the Quick Start.