Skip to content
/ dapi Public
forked from savaki/dapi

golang sql driver for aws data api

License

Notifications You must be signed in to change notification settings

Psykar/dapi

 
 

Repository files navigation

dapi

dapi is a Go sql.Driver for the AWS RDS Data API

Motivation

I wanted to the productivity of using gorm combined with the utility of convenience of the RDS Data API. Looking around, I couldn't find anything that fit the bill and hence, dapi

QuickStart

dapi is intended to work as a standard golang sql.Driver and specifically as a driver usable by gorm

func main() {
    var (
        s           = session.Must(session.NewSession(aws.NewConfig()))
        api         = rdsdataservice.New(s)
        driver      = dapi.New(api)
        database    = "the database name"
        secretARN   = "secret arn holding database credentials"
        resourceARN = "resource arn"
        dsn         = fmt.Sprintf("secret=%v resource=%v database=%v", secretARN, resourceARN, database)
        dialect     = "mysql"
    )

	sql.Register(dialect, driver)
	db, err := gorm.Open(dialect, dsn)
    // at this point you can use gorm as you normally would
}

Maturity

This project is very new and should not be used for production. Your mileage may vary.

About

golang sql driver for aws data api

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%