mirror of
https://github.com/sonr-io/sonr.git
synced 2026-08-02 17:31:39 +00:00
* feat(database): create schema for hway and motr * fix(gateway): correct naming inconsistencies in handlers * build: update schema file to be compatible with postgresql syntax * fix: update schema to be compatible with PostgreSQL syntax * chore: update query_hway.sql to follow sqlc syntax * ```text refactor: update query_hway.sql for PostgreSQL and sqlc ``` * feat: add vaults table to store encrypted data * refactor: Update vaults table schema for sqlc compatibility * chore(deps): Upgrade dependencies and add pgx/v5 * refactor(Makefile): move sqlc generate to internal/models * docs(foundations): remove outdated pages * chore(build): add Taskfile for build tasks * refactor(embed): move embed files to internal package * docs: add documentation for Cosmos SDK ORM
48 lines
772 B
Go
48 lines
772 B
Go
package embed
|
|
|
|
import (
|
|
_ "embed"
|
|
"reflect"
|
|
"strings"
|
|
)
|
|
|
|
//go:embed index.html
|
|
var IndexHTML []byte
|
|
|
|
//go:embed main.js
|
|
var MainJS []byte
|
|
|
|
//go:embed sw.js
|
|
var WorkerJS []byte
|
|
|
|
func getSchema(structType interface{}) string {
|
|
t := reflect.TypeOf(structType)
|
|
if t.Kind() == reflect.Ptr {
|
|
t = t.Elem()
|
|
}
|
|
|
|
if t.Kind() != reflect.Struct {
|
|
return ""
|
|
}
|
|
|
|
var fields []string
|
|
for i := 0; i < t.NumField(); i++ {
|
|
field := t.Field(i)
|
|
fieldName := toCamelCase(field.Name)
|
|
fields = append(fields, fieldName)
|
|
}
|
|
|
|
// Add "++" at the beginning, separated by a comma
|
|
return "++, " + strings.Join(fields, ", ")
|
|
}
|
|
|
|
func toCamelCase(s string) string {
|
|
if s == "" {
|
|
return s
|
|
}
|
|
if len(s) == 1 {
|
|
return strings.ToLower(s)
|
|
}
|
|
return strings.ToLower(s[:1]) + s[1:]
|
|
}
|