This section of the documentation is still work in progress and soon will be updated with more examples and details.
Please be patient while we work on the ongoing users and profiles refactoring as part of issue #376 .

Often there is a need for interacting with the database and performing advanced queries across multiple tables (eg. creating reports).

PocketBase doesn't limit you and expose its internal query mechanism using the local app.Dao() instance (think of Dao as repository and service layer in one).
You could find more information in the sub package documentation, but here are some examples:

// use the existing daos.Dao methods // --- user, err := app.Dao().FindUserByEmail("") result := app.Dao().IsCollectionNameUnique("demo", "") collection, err := app.Dao().FindCollectionByNameOrId("demo") record, err := app.Dao().FindFirstRecordByData(collection, "title", "test") // or execute raw queries (internal tables are prefixed with '_') // --- user := models.User{} app.Dao().DB(). NewQuery("SELECT * FROM _users WHERE email={:email}"). Bind(dbx.Params{"email": ""}). One(&user) // and much more...