MCPcopy
hub / github.com/pocketbase/pocketbase / BindDbx

Function BindDbx

plugins/jsvm/binds.go:669–690  ·  view source on GitHub ↗

BindDbx registers $dbx.* namespaced object with dbx database builder related methods. See https://pocketbase.io/jsvm/modules/_dbx.html.

(vm *goja.Runtime)

Source from the content-addressed store, hash-verified

667//
668// See https://pocketbase.io/jsvm/modules/_dbx.html.
669func BindDbx(vm *goja.Runtime) {
670 obj := vm.NewObject()
671 vm.Set("$dbx", obj)
672
673 obj.Set("exp", dbx.NewExp)
674 obj.Set("hashExp", func(data map[string]any) dbx.HashExp {
675 return dbx.HashExp(data)
676 })
677 obj.Set("not", dbx.Not)
678 obj.Set("and", dbx.And)
679 obj.Set("or", dbx.Or)
680 obj.Set("in", dbx.In)
681 obj.Set("notIn", dbx.NotIn)
682 obj.Set("like", dbx.Like)
683 obj.Set("orLike", dbx.OrLike)
684 obj.Set("notLike", dbx.NotLike)
685 obj.Set("orNotLike", dbx.OrNotLike)
686 obj.Set("exists", dbx.Exists)
687 obj.Set("notExists", dbx.NotExists)
688 obj.Set("between", dbx.Between)
689 obj.Set("notBetween", dbx.NotBetween)
690}
691
692// BindMails registers $mail.* namespaced object with common mail related helpers.
693//

Callers 6

TestBindDbxFunction · 0.85
TestLoadingDynamicModelFunction · 0.85
TestLoadingArrayOfFunction · 0.85
registerMigrationsMethod · 0.85
registerHooksMethod · 0.85

Calls 1

SetMethod · 0.65

Tested by 4

TestBindDbxFunction · 0.68
TestLoadingDynamicModelFunction · 0.68
TestLoadingArrayOfFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…