Inuk
Inuk
Explore posts from servers
CCoder.com
Created by Inuk on 2/12/2025 in #help
Custom hostname on Kubernetes?
I'm currently running Coder on https://coder.domain-i.payfor (domain omitted for privacy reasons) But when I run curl https://coder.domain-i.payfor/install.sh | sh I get the following error, how can I tell my Coder to use my domain?
$ curl https://coder.domain-i.payfor/install.sh | sh
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 8635 0 8635 0 0 26461 0 --:--:-- --:--:-- --:--:-- 26487
Installing coder-darwin-arm64 v2.19.0+2f32b11 from http://coder.coder.svc.cluster.local.

+ mkdir -p ~/.cache/coder/local_downloads
+ curl -#fL -o ~/.cache/coder/local_downloads/coder-darwin-arm64-v2.19.0+2f32b11.incomplete -C - http://coder.coder.svc.cluster.local/bin/coder-darwin-arm64
curl: (6) Could not resolve host: coder.coder.svc.cluster.local
$ curl https://coder.domain-i.payfor/install.sh | sh
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 8635 0 8635 0 0 26461 0 --:--:-- --:--:-- --:--:-- 26487
Installing coder-darwin-arm64 v2.19.0+2f32b11 from http://coder.coder.svc.cluster.local.

+ mkdir -p ~/.cache/coder/local_downloads
+ curl -#fL -o ~/.cache/coder/local_downloads/coder-darwin-arm64-v2.19.0+2f32b11.incomplete -C - http://coder.coder.svc.cluster.local/bin/coder-darwin-arm64
curl: (6) Could not resolve host: coder.coder.svc.cluster.local
11 replies
PPrisma
Created by Inuk on 7/24/2024 in #help-and-questions
Recursive CTE
Hello all, I'm trying to make a recursive query, but I'm not sure where to start? I have something like the following model:
model Role {
id String @unique
name String @unique

parent RoleRole[] @relation("parent")
child RoleRole[] @relation("child")
}

model RoleRole {
parentId String
childId String

parent Role @relation("parent", fields: [parentId], references: [id])
child Role @relation("child", fields: [childId], references: [id])

assignedAt DateTime @default(now())
assignedBy String

@@id([parentId, childId])
}
model Role {
id String @unique
name String @unique

parent RoleRole[] @relation("parent")
child RoleRole[] @relation("child")
}

model RoleRole {
parentId String
childId String

parent Role @relation("parent", fields: [parentId], references: [id])
child Role @relation("child", fields: [childId], references: [id])

assignedAt DateTime @default(now())
assignedBy String

@@id([parentId, childId])
}
And am looking to make a query that flattens this hierachy like the following example found on postgres' official docs:
WITH RECURSIVE search_tree(id, link, data) AS (
SELECT t.id, t.link, t.data
FROM tree t
UNION ALL
SELECT t.id, t.link, t.data
FROM tree t, search_tree st
WHERE t.id = st.link
)
SELECT * FROM search_tree;
WITH RECURSIVE search_tree(id, link, data) AS (
SELECT t.id, t.link, t.data
FROM tree t
UNION ALL
SELECT t.id, t.link, t.data
FROM tree t, search_tree st
WHERE t.id = st.link
)
SELECT * FROM search_tree;
My current two ideas is to use either raw SQL queries or make views, any thoughts?
4 replies