feat: basic functionality implemented
- added Core CRD to manage DB migrations & configuration, PostgREST and GoTrue (auth) - added APIGateway CRD to manage Envoy proxy - added Dashboard CRD to manage (so far) pg-meta and (soon) studio deployments - implemented basic Envoy control plane based on K8s watcher
This commit is contained in:
parent
2fae578618
commit
647f602c79
123 changed files with 12173 additions and 581 deletions
assets/migrations
|
@ -2,6 +2,7 @@ package migrations
|
|||
|
||||
import (
|
||||
"embed"
|
||||
"fmt"
|
||||
"io/fs"
|
||||
"iter"
|
||||
"path"
|
||||
|
@ -25,8 +26,18 @@ func MigrationScripts() iter.Seq2[Script, error] {
|
|||
return readScripts(path.Join(".", "migrations"))
|
||||
}
|
||||
|
||||
func RoleCreationScript(roleName string) (Script, error) {
|
||||
fileName := fmt.Sprintf("%s.sql", roleName)
|
||||
content, err := migrationsFS.ReadFile(path.Join("roles", fileName))
|
||||
if err != nil {
|
||||
return Script{}, err
|
||||
}
|
||||
|
||||
return Script{fileName, string(content)}, nil
|
||||
}
|
||||
|
||||
func readScripts(dir string) iter.Seq2[Script, error] {
|
||||
return iter.Seq2[Script, error](func(yield func(Script, error) bool) {
|
||||
return func(yield func(Script, error) bool) {
|
||||
files, err := migrationsFS.ReadDir(dir)
|
||||
if err != nil {
|
||||
yield(Script{}, err)
|
||||
|
@ -58,5 +69,5 @@ func readScripts(dir string) iter.Seq2[Script, error] {
|
|||
return
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue