drizzle-team / drizzle-team/drizzle-orm
[BUG]: drizzle-kit migrate parsing subdomain as hostname when multiple subdomains exist
- Dominant language
- TypeScript
- Stars
- 35.8k
- Forks
- 1.6k
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 4
Description
### What version of `drizzle-orm` are you using?
0.30.10
### What version of `drizzle-kit` are you using?
0.21.4
### Describe the Bug
I have a new database set up on DigitalOcean who has a host with multiple subdomains. The connection string looks like
```
postgresql://db:@.f.db.ondigitalocean.com:25060/db?sslmode=require
```
(The "UNIQUE_HASH" is essentially a slug containing only lowercase letters, numbers and dashes).
Note that there are 3 subdomains, the "UNIQUE_HASH", the single letter `f` and `db`, before the `ondigitalocean.com` hostname.
However, when I try to run `drizzle-kit migrate` I get the following error.
```
[⣯] applying migrations...Error: getaddrinfo EAI_AGAIN db
at GetAddrInfoReqWrap.onlookupall [as oncomplete] (node:dns:120:26)
at GetAddrInfoReqWrap.callbackTrampoline (node:internal/async_hooks:130:17) {
errno: -3001,
code: 'EAI_AGAIN',
syscall: 'getaddrinfo',
hostname: 'db'
}
```
Note the `hostname: 'db'` part.
### Expected behavior
The migration should go through normally, regardless of how many subdomains the host has in the connection string.
### Environment & setup
DigitalOcean app platform "dev" database.
I have disabled the "trusted sources" option specifically so I can perform these migrations remotely.
I'm also able to connect to the database using psql and dbeaver clients, so I can rule out a connection issue.
Contributor guide
Assessment
This issue has not been assessed yet.