# RegisterKpgService

`function` in `plugins` · v0.6.1

<https://docs.seedcord.org/packages/plugins/0.6.1/functions/register-kpg-service>

Registers a Kysely PG service with the specified key and options.

Associates a service class with a key for dependency injection. The service becomes available via `core.db.services[key]`.

```ts
RegisterKpgService<TKey>(
    key: TKey,
    options?: KpgServiceRegistrationOptions
): <Ctor extends Constructor<KpgServices[TKey]>>(
    ctor: Ctor
) => void
```

Registers a Kysely PG service with the specified key and options.

Associates a service class with a key for dependency injection. The service becomes available via `core.db.services[key]`.

Parameters.

- `key` `TKey` — Service key for registration and type-safe access
- `options?` `KpgServiceRegistrationOptions` — Additional registration options

Returns `<Ctor extends Constructor<KpgServices[TKey]>>(ctor: Ctor) => void`.
