ยฉ 2026 Hedgehog Software, LLC
Twitter
GitHub
Discord
System
Light
Dark
More
Communities
Docs
About
Terms
Privacy
Search
Star
Feedback
Setup for Free
Issue connect Worker and Planetscale - Cloudflare Developers
CD
Cloudflare Developers
โข
3y ago
โข
2 replies
MrXO
Issue connect Worker and Planetscale
Hi
,
I got this issue
:
workerd
/jsg
/util
.c
+
+
:275
: error
: e
= kj
/async
-io
-win32
.c
+
+
:813
: failed
: getaddrinfo
(
)
:
#11001 No such host is known
.
; params
.host
= undefined
; params
.service
=
stack
: 0 0 0 0 0 0 0 0 7ff67cbe5c04 0 0 7ff67cbe64a0 7ff67c5a2c6c
; sentryErrorContext
= jsgInternalError
my code
:
import
{ Hono
} from
'hono
'
;
import
{ connect
} from
'
@planetscale
/database
'
;
const app
= new Hono
(
)
;
let conn
;
app
.use
(async
(ctx
, next
)
=
>
{
if
(
!conn
)
{
const config
=
{
host
: ctx
.env
.DATABASE
_HOST
,
username
: ctx
.env
.DATABASE
_USERNAME
,
password
: ctx
.env
.DATABASE
_PASSWORD
,
fetch
:
(url
, init
)
=
>
{
delete
(init
)
[
"cache
"
]
;
return fetch
(url
, init
)
;
}
}
console
.log
(config
)
;
conn
= connect
(config
)
;
}
await next
(
)
;
}
)
;
async function fetchData
(query
: string
)
{
const data
= await conn
.execute
(query
)
;
return data
.rows
;
}
app
.get
(
'
/order
'
, async
(ctx
)
=
>
{
const data
= await fetchData
(
'SELECT
* FROM Orders
;
'
)
;
return ctx
.json
(data
)
;
}
)
;
app
.get
(
'
/product
'
, async
(ctx
)
=
>
{
const data
= await fetchData
(
'SELECT
* FROM Order
_Status
;
'
)
;
return ctx
.json
(data
)
;
}
)
;
export default app
;
Already connect via Cloudflare dashboard
, please help
Cloudflare Developers
Join
Welcome to the official Cloudflare Developers server. Here you can ask for help and stay updated with the latest news
86,942
Members
View on Discord
Resources
ModelContextProtocol
ModelContextProtocol
MCP Server
Similar Threads
Was this page helpful?
Yes
No
Recent Announcements
Similar Threads
Worker KV issue
CD
Cloudflare Developers / workers-and-pages-help
7mo ago
Worker DNS issue
CD
Cloudflare Developers / workers-and-pages-help
2y ago
R2 Worker Issue
CD
Cloudflare Developers / workers-and-pages-help
3y ago
worker CORS issue
CD
Cloudflare Developers / workers-and-pages-help
3y ago