Examples and templates

In this section, we will look at some examples of simple queries to the users table in our ORM system.

  1. Create a view that displays all directory items in code order.

const selectAllUsers = await databaseManager.queryBuilder<Users[]>()
    .createView('allUsersView')
    .select()
    .from('users')
    .execute();
  1. Create a selection query with logical operations under record selection conditions.

const selectQueryExample = await databaseManager.queryBuilder<Tasks[]>()
    .select(['task_id', 'title', 'status'])
    .from('tasks')
    .where({
        conditions: {
            is_completed: { eq: false },
            price: { gt: 50 }
        },
        logicalOperator: 'and'
    })
    .orderBy('due_date', 'ASC')
    .execute();
  1. Subqueries.

  1. Joining tables.

  1. Connection.

  1. Create a simple grouping query using the Sum statistical function.

  1. Creating a grouping query using the HAVING clause.

  1. Create a group request.

  1. Create an update request.

  1. Create a removal request.

  1. Create an add request.

  1. Creating triggers.

  1. Creation of indexes.

  1. Caching.

Last updated