command
module
Version:
v0.0.0-...-3907bf9
Opens a new window with list of versions in this module.
Published: Jun 29, 2024
License: MIT
Opens a new window with license information.
Imports: 14
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
siesta
Intoduction
Siesta genarates type-safe REST APIs directly from your postgres DB instance 🐘
Installation
Siesta requires Go 1.22+
go install github.com/adisupe94/siesta
Usage
- Create your database schema anyway you like.
- Run siesta from your project( create one if needed) to generate type-safe code to access your database create http handlers.
mkdir myapp && cd myapp
go mod init myapp
siesta -db=postgresql://username:password@host:5432/database_name
- In your main func, import the
GetRouter
and call it with the postgres connection/pool. Hook it up to your http server like this.
router := GetRouter(db)
httpServer := &http.Server{
Addr: ":8080",
Handler: router,
}
log.Fatal(httpServer.ListenAndServe())
Documentation
¶
There is no documentation for this package.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.