feat(storage): add native PostgreSQL runtime and verified offline application import
Build and publish container images / images (push) Failing after 12m29s
Build and publish container images / images (push) Failing after 12m29s
This commit is contained in:
1 parent
96065d1e89
commit
0ba1dcfef0
243 files changed
+21441
-3090
No files matched your search
@@ -24,6 +24,7 @@ func (s *Store) CityNode(domainUUID, kind, id string) (CityNodeDetail, error) {
|
||||
// <Quartier-name>/<Street-name>. Qualified lookup and parent checks happen in
|
||||
// the same SQL snapshot, without enumerating the City or opening nested cursors.
|
||||
func (s *Store) CityNodeContext(parent context.Context, domainUUID, kind, id string) (detail CityNodeDetail, lookupErr error) {
|
||||
defer func() { lookupErr = s.sqlError("city node", lookupErr) }()
|
||||
id = strings.ToLower(strings.TrimSpace(id))
|
||||
if kind != "quartier" && kind != "street" && kind != "spot" {
|
||||
return detail, sql.ErrNoRows
|
||||
@@ -50,7 +51,7 @@ func (s *Store) CityNodeContext(parent context.Context, domainUUID, kind, id str
|
||||
from := "zones n"
|
||||
columns := `n.uuid,n.domain_uuid,n.kind,COALESCE(n.parent_uuid,''),n.name,n.title,n.description,n.state,n.path_prefix,n.sort_key,n.version`
|
||||
ancestors := `,'','','','','','','',''`
|
||||
where := `n.domain_uuid=? AND n.state!='archived' AND n.kind=?`
|
||||
where := `n.domain_uuid=` + s.sqlParam(1) + ` AND n.state!='archived' AND n.kind=` + s.sqlParam(2)
|
||||
args := []any{domainUUID, kind}
|
||||
if kind == "street" {
|
||||
from += ` JOIN zones q ON q.uuid=n.parent_uuid AND q.domain_uuid=n.domain_uuid AND q.kind='quartier' AND q.state!='archived'`
|
||||
@@ -61,19 +62,19 @@ func (s *Store) CityNodeContext(parent context.Context, domainUUID, kind, id str
|
||||
JOIN zones q ON q.uuid=st.parent_uuid AND q.domain_uuid=st.domain_uuid AND q.kind='quartier' AND q.state!='archived'`
|
||||
columns = `n.uuid,n.domain_uuid,'spot',st.uuid,n.name,n.title,n.summary,n.state,n.path_prefix,ss.sort_key,n.version`
|
||||
ancestors = `,q.uuid,q.name,q.title,q.path_prefix,st.uuid,st.name,st.title,st.path_prefix`
|
||||
where = `n.domain_uuid=? AND n.state!='archived'`
|
||||
where = `n.domain_uuid=` + s.sqlParam(1) + ` AND n.state!='archived'`
|
||||
args = []any{domainUUID}
|
||||
}
|
||||
if len(parts) == 2 {
|
||||
// A qualified URL is name based. Explicit UUID selectors use the short
|
||||
// /s/uuid:... route instead of mixing two different identity models.
|
||||
where += " AND q.name=? AND n.name=?"
|
||||
where += " AND q.name=" + s.sqlParam(len(args)+1) + " AND n.name=" + s.sqlParam(len(args)+2)
|
||||
args = append(args, parts[0], parts[1])
|
||||
} else if strings.HasPrefix(id, "uuid:") {
|
||||
where += " AND n.uuid=?"
|
||||
where += " AND n.uuid=" + s.sqlParam(len(args)+1)
|
||||
args = append(args, strings.TrimPrefix(id, "uuid:"))
|
||||
} else {
|
||||
where += " AND n.name=?"
|
||||
where += " AND n.name=" + s.sqlParam(len(args)+1)
|
||||
args = append(args, id)
|
||||
}
|
||||
rows, err := s.DB.QueryContext(ctx, `SELECT `+columns+ancestors+` FROM `+from+` WHERE `+where+` LIMIT 2`, args...)
|
||||
|
||||
Reference in new issue
Block a user