Skip to content

sqlc-dev/quickdb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

quickdb

Usage

package main

import (
	"context"
	"log"
	"os"

	"github.com/sqlc-dev/quickdb"
	pb "github.com/sqlc-dev/quickdb/v1"
)

func main() {
	ctx := context.Background()
	projectID := os.Getenv("SQLC_PROJECT_ID")
	authToken := os.Getenv("SQLC_AUTH_TOKEN")
	client, err := quickdb.NewClient(projectID, authToken)
	if err != nil {
		log.Fatal(err)
	}

	resp, err := client.CreateEphemeralDatabase(ctx, &pb.CreateEphemeralDatabaseRequest{
		Engine: "postgresql",
	})
	if err != nil {
		log.Fatal(err)
	}

	log.Println(resp.Uri)

	_, err = client.DropEphemeralDatabase(ctx, &pb.DropEphemeralDatabaseRequest{
		DatabaseId: resp.DatabaseId,
	})
	if err != nil {
		log.Fatal(err)
	}
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages