feat(sql): Add select query
This commit is contained in:
14
build/select.go
Normal file
14
build/select.go
Normal file
@@ -0,0 +1,14 @@
|
||||
package build
|
||||
|
||||
import (
|
||||
"git.secnex.io/secnex/pgson/schema"
|
||||
"git.secnex.io/secnex/pgson/sql"
|
||||
)
|
||||
|
||||
func Select(s *schema.Table, where map[string]any) (*string, error) {
|
||||
if err := sql.ValidateIdent(s.Name); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return nil, nil
|
||||
}
|
||||
12
query.go
12
query.go
@@ -9,6 +9,18 @@ func CreateTable(schema *schema.Table) (*string, error) {
|
||||
return build.CreateTable(schema)
|
||||
}
|
||||
|
||||
func DropTable(schema *schema.Table) (*string, error) {
|
||||
return build.DropTable(schema)
|
||||
}
|
||||
|
||||
func TruncateTable(schema *schema.Table) (*string, error) {
|
||||
return build.TruncateTable(schema)
|
||||
}
|
||||
|
||||
func Select(schema *schema.Table, where map[string]any) (*string, error) {
|
||||
return build.Select(schema, where)
|
||||
}
|
||||
|
||||
func Insert(schema *schema.Table, data map[string]any) (*string, error) {
|
||||
return build.Insert(schema, data)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user