rubenf
rubenf2y ago

Resource Types

Before:
import type Resource from https://...
export async function main(db: Resource<'postgresql'>)
import type Resource from https://...
export async function main(db: Resource<'postgresql'>)
After:
type Postgresql = {
host: string,
port: number,
user: string,
dbname: string,
sslmode: string,
password: string

}

OR

type Postgresql = object

export async function main(db: Postgresql)
type Postgresql = {
host: string,
port: number,
user: string,
dbname: string,
sslmode: string,
password: string

}

OR

type Postgresql = object

export async function main(db: Postgresql)
5 Replies
Sindre
Sindre2y ago
Tried it now. Like it, def. an improvement. But when searching a resource type the text changed.
No description
Sindre
Sindre2y ago
To compare before I searched:
No description
rubenf
rubenf2y ago
That's kind of not a bug, it's so that you can search on all fields including description We could improve the rendering but it was an easy hack to search on all fields at once
Sindre
Sindre2y ago
then leave it, no one (except me) will notice
rubenf
rubenf2y ago
but yeah glad you like the new resource type thought it would be important to refactor as early as possible