Skip to content

Psykar/dapi

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Go 100.0%