# RegisterKyselyService

`function` in `plugin-kysely` · v0.9.0

<https://seedcord.org/docs/packages/plugin-kysely/0.9.0/functions/register-kysely-service>

Registers the service under `key`, which is also its table name unless `options.table` gives another.
Handlers read it from the plugin's `services[key]`.

```ts
RegisterKyselyService<TKey, TTable>(
    key: TKey,
    options?: KyselyServiceRegistrationOptions<TTable>
): <Ctor extends Constructor<KyselyServices[TKey] & { table: TTable }>>(
    ctor: Ctor
) => void
```

Registers the service under `key`, which is also its table name unless `options.table` gives another.
Handlers read it from the plugin's `services[key]`.

Parameters.

- `key` `TKey` — Service key for registration and type-safe access
- `options?` `KyselyServiceRegistrationOptions<TTable>`

Returns `<Ctor extends Constructor<KyselyServices[TKey] & { table: TTable; }>>(ctor: Ctor) => void`.
