Back to Pocketbase

Interface baseCollection

static/jsvm/interfaces/core.baseCollection.html

latest3.9 KB
Original Source

Interface baseCollection

Todo

experiment eventually replacing the rules *string with a struct?

Hierarchy

Index

Methods

isNewlastSavedPKmarkAsNewmarkAsNotNewpkpostScan

Properties

createRule?createddeleteRule?fieldsidindexeslistRule?namerawOptionssystemtypeupdateRule?updatedviewRule?

Methods

isNew

  • isNew(): boolean

IsNew indicates what type of db query (insert or update) should be used with the model instance.

Returns boolean

lastSavedPK

  • lastSavedPK(): any

LastSavedPK returns the last saved primary key of the model.

Its value is updated to the latest PK value after MarkAsNotNew() or PostScan() calls.

Returns any

markAsNew

  • markAsNew(): void

MarkAsNew clears the pk field and marks the current model as "new" (aka. forces m.IsNew() to be true).

Returns void

markAsNotNew

  • markAsNotNew(): void

MarkAsNew set the pk field to the Id value and marks the current model as NOT "new" (aka. forces m.IsNew() to be false).

Returns void

pk

  • pk(): any

Returns any

postScan

  • postScan(): void

PostScan implements the [dbx.PostScanner] interface.

It is usually executed right after the model is populated with the db row values.

Returns void

Properties

Optional createRule

createRule?: string

created

created: types.DateTime

Optional deleteRule

deleteRule?: string

fields

fields: core.FieldsList

id

id: string

Id is the primary key of the model. It is usually autogenerated by the parent model implementation.

indexes

indexes: JSONArray<string>

Optional listRule

listRule?: string

name

name: string

rawOptions

rawOptions: JSONRaw

RawOptions represents the raw serialized collection option loaded from the DB. NB! This field shouldn't be modified manually. It is automatically updated with the collection type specific option before save.

system

system: boolean

System prevents the collection rename, deletion and rules change. It is used primarily for internal purposes for collections like "_superusers", "_externalAuths", etc.

type

type: string

Optional updateRule

updateRule?: string

updated

updated: types.DateTime

Optional viewRule

viewRule?: string

Settings

Member Visibility

  • Inherited

Theme

OSLightDark

On This Page

Generated using TypeDoc