Type Alias: Crud<T>
Crud<
T> =object
Defined in: src/write/util.ts:29
This example requires Node.js.
ts
import type { Crud } from 'osu-files'
const value = {} as Crud<unknown>
return valueType Parameters
| Type Parameter |
|---|
T |
Methods
create()
create(
input):T
Defined in: src/write/util.ts:38
Creates one entity.
Parameters
| Parameter | Type |
|---|---|
input | Record<string, unknown> |
Returns
T
This example requires Node.js.
ts
import type { Crud } from 'osu-files'
const crud = {} as Crud<unknown>
return crud.create({})delete()
delete(
id):boolean
Defined in: src/write/util.ts:56
Deletes one entity by ID.
Parameters
| Parameter | Type |
|---|---|
id | unknown |
Returns
boolean
This example requires Node.js.
ts
import type { Crud } from 'osu-files'
const crud = {} as Crud<unknown>
return crud.delete('id')update()
update(
id,patch):T
Defined in: src/write/util.ts:47
Updates one entity by ID. Protected fields are rejected.
Parameters
| Parameter | Type |
|---|---|
id | unknown |
patch | UpdatePatch<T> |
Returns
T
This example requires Node.js.
ts
import type { Crud } from 'osu-files'
const crud = {} as Crud<unknown>
return crud.update('id', {})upsert()
upsert(
input):T
Defined in: src/write/util.ts:65
Creates an entity or updates the existing one.
Parameters
| Parameter | Type |
|---|---|
input | Record<string, unknown> |
Returns
T
This example requires Node.js.
ts
import type { Crud } from 'osu-files'
const crud = {} as Crud<unknown>
return crud.upsert({})