diff --git a/assets/search.js b/assets/search.js index 1e1cb46..2589196 100644 --- a/assets/search.js +++ b/assets/search.js @@ -1 +1 @@ -window.searchData = "data:application/octet-stream;base64,H4sIAAAAAAAAA7VcW2/byA7+L8qrN7XmJilv3V6AAnu2wNk9fTGKQomVVjiJ7SMp6QZF//vBSCOLlMnRSHaf3I1Jfhx+JGdEjfdHVO2/19HN5kf033K3jW6MWkW7/LGIbqK7qsib4m3e5G/2u6b4p4lW0VP1EN1E90+7u6bc7+pXJzLX35rHh2gV3T3kdV3U0U0U/Vz1xoU2R+sf3oxVPx5am0eUctcU1X1+V9SvWGEvXLwWw2rybX5oimq+9atBc0Bp6u1vZf1buftWVGVTbKNVdMirYtd4V8a4VuyasimLBSu/Aqq/yLnd/u3tn08PDwucA6qXc06ssyTW4uifFf67ynf1/b56BPw2L4eifjX61psuRms55OeXL9ZCgLmroySwChY1dpBfyjtL5sub/e6+/PpU5bgaOgcokXMXxdqcWhnp79Ty3pfFwzZgjYTcZRbKGQ5bLeU+0+CozgmLJ7RrhveKsUW6PaCKg04u6QAnkGTRB0CKtUqHrWf/tAsL2lUvGthhAsDv7Z+CsJ3kZaE/7opw9E74cg6Uu7qoAiN/lL0c/P+eiuolDL0XvTD46932Q1NUeRNIwqnS5R36V36Y50yncDlHquJx/xwYkKPs5eCfDttgPo6y58GP+/hrz+kRfO8//cI11UUztTdAm1dI3tNYe0cXNVaEuKCxToB7GyvCnt9YA6B9jfUEfXZjnXBgorEi/CWNdQLe31gR+oLGGgIe0FhP3VjaWAMd8jVW0pnZjXXCkYnGinxY0lgn4CcaK4Jf0lgJ+HFj/Xdx2Ndls/dk5yAS3l79fW5kkWh1J0sBfi7pbmPEkwa3ENDX0yjMcVtbADvRycaoRDNbAOrvX2PM0xa2FDKga5HgTOM6ww1fr+JcGLerBfATHWqMTDSpBaATfWkMSrSmQFDYjeA0g4SGAuEP7Hf7x8eC6UUnFq8GaWYtyEsG8t7OKOgJwSniUfgMwDIYrTwXyjuMOMWbn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S2320l9OBTVCjwtmQsbPpPjOuG/c3z4E50ICEU5fuBKzcZ8bxUBcNUesCpI5weZdxXHS/8gVEgpAZtzzD9Yu5z5sGPvusuVU1aHuQoHNpVoXZlkA70Fz+jI9oAhCsuALqr9UDIgGWcMTJvgu4z4wL5HDprugu3YE9AdRG1s8kYm4xPBvIZgJ54DrdLGbhzhWzy5zcCpCXKfSSW7H7qThIGDjKcRVlyLb7eRUdykPxUO6K6Gbz+efP/wMRELacWV4AAA=="; \ No newline at end of file +window.searchData = "data:application/octet-stream;base64,H4sIAAAAAAAAA7VcW2/byA7+L8qrN7XmJilv3V6AAnu2wNk9fTGKQomVVjiJ7SMp6QZF//vBSCOLlMnRSHaf3I1Ifhx+JDWiRvsjqvbf6+hm8yP6b7nbRjdGraJd/lhEN9FdVeRN8TZv8jf7XVP800Sr6Kl6iG6i+6fdXVPud/WrE5nrb83jQ7SK7h7yui7q6CaKfq5640Kbo/UPb8aqHw+tzSNKuWuK6j6/K+pXrLAXLl6LYTX5Nj80RTXf+tWgOaA09fa3sv6t3H0rqrIpttEqOuRVsWu8K2NcK3ZN2ZTFgpVfAdVf5Nxu//b2z6eHhwXOAdXLOSfWWRJrcfTPCv9d5bv6fl89An6bl0NRvxpd9aaL0VoO+fnli7UQYO7qKAmsgkWNHeSX8s6S+fJmv7svvz5VOa6GzgFK5NxFsTanVkb6O7W892XxsA1YIyEX3luopgXzNrRhhZfp2CJdmSjZoZNLiu8Ekqy3AEixVunQ9fdPu7CgXfWigcUdAH5v/xSE7SQvC/1xV4Sjd8KXc6Dc1UUVGPmj7OXg//dUVC9h6L3ohcFf77YfmqLKm0ASTpUu79C/8sM8ZzqFyzlSFY/758CAHGUvB/902AbzcZQ9D37cx197Nm7guv/mANdUF83UvQHavELynsbaO7qosSLEBY11AtzbWBH2/MYaAO1rrCfosxvrhAMTjRXhL2msE/D+xorQFzTWEPCAxnrqxtLGGuiQr7GSzsxurBOOTDRW5MOSxjoBP9FYEfySxkrAjxvrv4vDv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VgPkH7ryJ6fcgHHm7/fZ2TBu8dTt9t1VXLhcSt7dJuJZ/YhLcagyXCbvjF4wgBKASDXdb6L9jBWqATO2cNlzc++9QgToIgXYPTIarRXfAHVQT3MY7cOGsSPebccXZWst327I/tA7swixydkTm7LrfjEuT3u6jPYwObIISjXtba8e2+824ZtyfNAfmQP8RTl26DbByvxnHQ100RK0LkDrC5V3GcdF91QuIhNt4tzzD9Yu5j5sGPvqsuVU16O4gQefSrApzVwLtQHP5M96hCUCw4gqoP0YPiARYwhEn+y7gfjMukMMhu6I7ZAduCaA2sqTvTtxieDaQzQTywHW6WczCqojZZU7eCpCXKfSSW7H7NBwkDJzguIoyZNv9vIoO5aF4KHdFdLP5/PPn/wG30L5jxF0AAA=="; \ No newline at end of file diff --git a/classes/DataAdapterBase.html b/classes/DataAdapterBase.html index 429ddaa..6a84ec0 100644 --- a/classes/DataAdapterBase.html +++ b/classes/DataAdapterBase.html @@ -1,5 +1,5 @@ DataAdapterBase | @egomobile/orm

Class DataAdapterBaseAbstract

A basic data adapter.

-

Implements

Constructors

Implements

Constructors

Properties

Accessors

Methods

count @@ -18,55 +18,55 @@ setContext update

Constructors

Properties

_context: Nilable<IDataContext>

The underlying adapter.

-

Accessors

Accessors

Methods

Methods

  • Counts a list of items.

    Type Parameters

    • T extends unknown = any

    Parameters

    • type: Constructor<T>

      The class / type.

    • Optional options: Nilable<IFindOptions>

      The custom options.

    Returns Promise<number>

    The promise with the items.

    Example

    import { IDataRepository } from '@egomobile/orm'

    class User {
    id: number = -1;
    }

    async function countActiveUsers(repo: IDataRepository): Promise<number> {
    // in SQL context
    return await repo.count(User, {
    where: 'is_active=$1 AND (is_deleted=$2 OR is_deleted IS NULL)',
    params: [ true, false ], // $1, $2
    })
    }
    -
  • Finds a list of items.

    Type Parameters

    • T extends unknown = any

    Parameters

    • type: Constructor<T>

      The class / type.

    • Optional options: Nilable<IFindOptions>

      The custom options.

    Returns Promise<T[]>

    The promise with the items.

    Example

    import { IDataRepository } from '@egomobile/orm'

    // keep sure to initialize your props
    // with a value, which is not (undefined)
    class User {
    id: number = -1;
    first_name: string = '';
    last_name: string = '';
    is_active: boolean | null = null;
    is_deleted: boolean = false;
    }

    async function load10ActiveUsersAndSkipFirst(repo: IDataRepository): Promise<User[]> {
    // in SQL context
    return await repo.find(User, {
    where: 'is_active=$1 AND (is_deleted=$2 OR is_deleted IS NULL)',
    params: [ true, false ], // $1, $2

    offset: 1,
    limit: 10
    })
    }
    -
  • Tries to find a simple item.

    Type Parameters

    • T extends unknown = any

    Parameters

    • type: Constructor<T>

      The class / type.

    • Optional options: Nilable<IFindOneOptions>

      The custom options.

    Returns Promise<null | T>

    The promise with the item or (null) if not found.

    Example

    import { IDataRepository } from '@egomobile/orm'

    // keep sure to initialize your props
    // with a value, which is not (undefined)
    class User {
    id: number = -1;
    first_name: string = '';
    last_name: string = '';
    is_active: boolean | null = null;
    is_deleted: boolean = false;
    }

    async function loadLastActiveUser(repo: IDataRepository): Promise<User> {
    // in SQL context
    return await repo.findOne(User, {
    where: 'is_active=$1 AND (is_deleted=$2 OR is_deleted IS NULL)',
    params: [ true, false ], // $1, $2

    sort: {
    'created': 'DESC', // first sort by 'created' (descending)
    'id': 'DESC', // then by 'id' (descending)
    'last_name': 'ASC', // then by 'last_name' (ascending)
    'first_name': 'ASC' // then by 'first_name' (ascending)
    }
    })
    }
    -
  • Returns the list of entity/table fields, which represent the IDs of a row.

    Parameters

    • type: Constructor<any>

      The type.

    Returns string[]

    The list of field names.

    -
  • Returns the list of entity fields columns, which represent the IDs of a row, or throws an exception if not defined.

    Parameters

    • type: Constructor<any>

      The type.

    Returns string[]

    The list of ID fields.

    -
  • Returns the name of the underlying entity/table by type or throws an exception, if not configured.

    +
  • Returns the name of the underlying entity/table by type or throws an exception, if not configured.

    Parameters

    • type: Constructor<any>

      The type.

    Returns string

    The name of the underlying entity/table name.

    -
  • Insert one or more entities.

    Type Parameters

    • T extends unknown = any

    Parameters

    • entityOrEntities: T | List<T>

      The entity to insert.

    Returns Promise<T | T[]>

    The promise with the inserted entity/entities.

    Example

    import { IDataRepository } from '@egomobile/orm'

    // keep sure to initialize your props
    // with a value, which is not (undefined)
    class User {
    id: number | null = null;
    first_name: string = '';
    last_name: string = '';
    is_active: boolean | null = null;
    is_deleted: boolean = false;
    }

    async function createUser(repo: IDataRepository, firstName: string, lastName: string): Promise<User> {
    const newUser = new User()
    newUser.last_name = lastName
    newUser.first_name = firstName
    newUser.is_active = true

    await repo.insert(newUser)
    }
    -
  • Does a raw query.

    Parameters

    • q: any

      The object / value, which represents the query.

    • Rest ...paramsOrArgs: any[]

      A list of optional parameters or arguments for the query.

    Returns Promise<any>

    The promise with the raw result.

    Example

    import { IDataRepository } from '@egomobile/orm'

    async function deleteInactiveUsers(repo: IDataRepository) {
    // in SQL context
    //
    // result is an object or value
    // from the underlying data adapter itself
    const result: any = await repo.query(
    "UPDATE users SET is_deleted=$1 WHERE is_active=$2;",
    false, false // $1, $2
    )
    }
    -
  • Does a raw query and maps the result(s) to entity objects. The classes do not need to be configured in context, so it is possbile to implement and work with "joins". The difference to queryAndMap() is, that is makes use of cursor pattern @@ -77,7 +77,7 @@

Returns AsyncGenerator<T, any, unknown>

The async generator.

Example

import { IDataRepository } from '@egomobile/orm'

class UserAndRole {
role_id!: string;
user_id!: string;
}

async function loadUserRoles(repo: IDataRepository): AsyncGenerator<UserAndRole> {
// PostgreSQL example
// s. https://github.com/egomobile/node-orm-pg

return repo.queryAndIterate(
UserAndRole, // type of the target entity
// does not need to be configured
// in data context

// build query
"SELECT DISTINCT ur.id AS role_id, u.id AS user_id " +
"FROM user_roles ur " +
"INNER JOIN users u ON u.id = ur.user_id " +
"WHERE u.is_active = $1 AND u.is_deleted = $2;",

// additional parameters
true, false // $1, $2
)
}

const iterator = loadUserRoles(
// ... your repo instance ...
)

for await (const userAndRole of iterator) {
// your code ...
}
-
  • Does a raw query and maps the result(s) to entity objects. The classes do not need to be configured in context, so it is possbile to implement and work with "joins".

    Parameters

    • type: Constructor<any>

      The target type.

      @@ -86,16 +86,16 @@

    Returns Promise<any[]>

    The promise with the mapped entities.

    Example

    import { IDataRepository } from '@egomobile/orm'

    class UserAndRole {
    role_id!: string;
    user_id!: string;
    }

    async function loadUserRoles(repo: IDataRepository): Promise<UserAndRole[]> {
    // PostgreSQL example
    // s. https://github.com/egomobile/node-orm-pg

    return await repo.queryAndMap(
    UserAndRole, // type of the target entity
    // does not need to be configured
    // in data context

    // build query
    "SELECT DISTINCT ur.id AS role_id, u.id AS user_id " +
    "FROM user_roles ur " +
    "INNER JOIN users u ON u.id = ur.user_id " +
    "WHERE u.is_active = $1 AND u.is_deleted = $2;",

    // additional parameters
    true, false // $1, $2
    )
    }
    -
  • Removes one or more entities.

    Type Parameters

    • T extends unknown = any

    Parameters

    • entityOrEntities: T | List<T>

      The entity to remove.

    Returns Promise<T | T[]>

    The promise with the removed entity/entities.

    Example

    import { IDataRepository } from '@egomobile/orm'

    // keep sure to initialize your props
    // with a value, which is not (undefined)
    class User {
    id: number = -1;
    is_active: boolean | null = null;
    }

    async function removeInactiveUsers(repo: IDataRepository, users: User[]) {
    const inactiveUsers = users.find(u => u.is_active === false)

    await repo.remove(inactiveUsers)
    }
    -
  • Updates one or more entities.

    +

Returns this

Generated using TypeDoc

\ No newline at end of file +

Generated using TypeDoc

\ No newline at end of file diff --git a/classes/ValidationError.html b/classes/ValidationError.html index 1dbd343..99162a2 100644 --- a/classes/ValidationError.html +++ b/classes/ValidationError.html @@ -1,5 +1,5 @@ ValidationError | @egomobile/orm

Class ValidationError

An error which is thrown if a validation fails.

-

Hierarchy

  • Error
    • ValidationError

Constructors

Hierarchy

  • Error
    • ValidationError

Constructors

Properties

message name stack? diff --git a/functions/createDataContext.html b/functions/createDataContext.html index 57e6ed0..945cbdf 100644 --- a/functions/createDataContext.html +++ b/functions/createDataContext.html @@ -1,4 +1,4 @@ createDataContext | @egomobile/orm

Generated using TypeDoc

\ No newline at end of file +

Generated using TypeDoc

\ No newline at end of file diff --git a/functions/getDbValue.html b/functions/getDbValue.html index 3f7ada2..afa6079 100644 --- a/functions/getDbValue.html +++ b/functions/getDbValue.html @@ -3,4 +3,4 @@

Returns T

Is explicit (null) or not.

Example

import { getDbValue, NULL as DbNull, Nullable } from '@egomobile/orm'

const a: Nullable<number> = 0
getDbValue(a) // 0

const b: Nullable<number> = DbNull
getDbValue(b) // (null)
-

Generated using TypeDoc

\ No newline at end of file +

Generated using TypeDoc

\ No newline at end of file diff --git a/functions/isExplicitNull.html b/functions/isExplicitNull.html index cf7587f..23af672 100644 --- a/functions/isExplicitNull.html +++ b/functions/isExplicitNull.html @@ -3,4 +3,4 @@

Returns val is typeof NULL

Is explicit (null) or not.

Example

import { isExplicitNull, NULL } from '@egomobile/orm'

// following values return (true)
isExplicitNull(NULL)
isExplicitNull(Symbol('NULL'))

// anything else is (false)
-

Generated using TypeDoc

\ No newline at end of file +

Generated using TypeDoc

\ No newline at end of file diff --git a/functions/verifyEntityConfigurations.html b/functions/verifyEntityConfigurations.html index 560fbff..c558b83 100644 --- a/functions/verifyEntityConfigurations.html +++ b/functions/verifyEntityConfigurations.html @@ -3,4 +3,4 @@

Type Parameters

Parameters

Returns Promise<void>

No result here.

-
  • Type Parameters

    Parameters

    Returns void

  • Generated using TypeDoc

    \ No newline at end of file +
  • Type Parameters

    Parameters

    Returns void

  • Generated using TypeDoc

    \ No newline at end of file diff --git a/functions/verifyForStrictEntityDocumentation.html b/functions/verifyForStrictEntityDocumentation.html index dd3129d..ebc4aac 100644 --- a/functions/verifyForStrictEntityDocumentation.html +++ b/functions/verifyForStrictEntityDocumentation.html @@ -2,4 +2,4 @@ If not, if throws an error.

    Type Parameters

    Parameters

    Returns void

    Throws

    ValidationError At least one validation failed.

    -

    Generated using TypeDoc

    \ No newline at end of file +

    Generated using TypeDoc

    \ No newline at end of file diff --git a/interfaces/ICreateDataContextOptions.html b/interfaces/ICreateDataContextOptions.html index 6145ffd..e56f3bc 100644 --- a/interfaces/ICreateDataContextOptions.html +++ b/interfaces/ICreateDataContextOptions.html @@ -1,10 +1,10 @@ ICreateDataContextOptions | @egomobile/orm

    Interface ICreateDataContextOptions

    Options for 'createDataContext()' function.

    -
    interface ICreateDataContextOptions {
        adapter: IDataAdapter;
        entities: EntityConfigurations;
        noDbNull?: Nilable<boolean>;
    }

    Hierarchy (view full)

    Properties

    interface ICreateDataContextOptions {
        adapter: IDataAdapter;
        entities: EntityConfigurations;
        noDbNull?: Nilable<boolean>;
    }

    Hierarchy (view full)

    Properties

    adapter: IDataAdapter

    The data adapter to use.

    -

    The configurations of all entities / tables.

    -
    noDbNull?: Nilable<boolean>

    Indicates that the special value NULL should not be used +

    The configurations of all entities / tables.

    +
    noDbNull?: Nilable<boolean>

    Indicates that the special value NULL should not be used by default.

    Default

    false

    -

    Generated using TypeDoc

    \ No newline at end of file +

    Generated using TypeDoc

    \ No newline at end of file diff --git a/interfaces/IDataAdapter.html b/interfaces/IDataAdapter.html index 847f127..691b6b4 100644 --- a/interfaces/IDataAdapter.html +++ b/interfaces/IDataAdapter.html @@ -1,5 +1,5 @@ IDataAdapter | @egomobile/orm

    Interface IDataAdapter

    A data adapter, like a Mongo or PostgreSQL connection.

    -
    interface IDataAdapter {
        count<T>(type, options?): Promise<number>;
        find<T>(type, options?): Promise<T[]>;
        findOne<T>(type, options?): Promise<null | T>;
        insert<T>(entity): Promise<T>;
        insert<T>(entities): Promise<T[]>;
        insert<T>(entityOrEntities): Promise<T | T[]>;
        query<T>(q, ...paramsOrArgs?): Promise<T>;
        queryAndIterate<T>(type, q, ...paramsOrArgs?): AsyncGenerator<T, any, unknown>;
        queryAndMap<T>(type, q, ...paramsOrArgs?): Promise<T[]>;
        remove<T>(entity): Promise<T>;
        remove<T>(entities): Promise<T[]>;
        remove<T>(entityOrEntities): Promise<T | T[]>;
        setContext(context): this;
        update<T>(entity): Promise<T>;
        update<T>(entities): Promise<T[]>;
        update<T>(entityOrEntities): Promise<T | T[]>;
    }

    Hierarchy (view full)

    Implemented by

    Methods

    interface IDataAdapter {
        count<T>(type, options?): Promise<number>;
        find<T>(type, options?): Promise<T[]>;
        findOne<T>(type, options?): Promise<null | T>;
        insert<T>(entity): Promise<T>;
        insert<T>(entities): Promise<T[]>;
        insert<T>(entityOrEntities): Promise<T | T[]>;
        query<T>(q, ...paramsOrArgs?): Promise<T>;
        queryAndIterate<T>(type, q, ...paramsOrArgs?): AsyncGenerator<T, any, unknown>;
        queryAndMap<T>(type, q, ...paramsOrArgs?): Promise<T[]>;
        remove<T>(entity): Promise<T>;
        remove<T>(entities): Promise<T[]>;
        remove<T>(entityOrEntities): Promise<T | T[]>;
        setContext(context): this;
        update<T>(entity): Promise<T>;
        update<T>(entities): Promise<T[]>;
        update<T>(entityOrEntities): Promise<T | T[]>;
    }

    Hierarchy (view full)

    Implemented by

    Methods

    count find findOne insert @@ -15,30 +15,30 @@

    Returns Promise<number>

    The promise with the items.

    Example

    import { IDataRepository } from '@egomobile/orm'

    class User {
    id: number = -1;
    }

    async function countActiveUsers(repo: IDataRepository): Promise<number> {
    // in SQL context
    return await repo.count(User, {
    where: 'is_active=$1 AND (is_deleted=$2 OR is_deleted IS NULL)',
    params: [ true, false ], // $1, $2
    })
    }
    -
    • Finds a list of items.

      Type Parameters

      • T extends unknown = any

      Parameters

      • type: Constructor<T>

        The class / type.

      • Optional options: Nilable<IFindOptions>

        The custom options.

      Returns Promise<T[]>

      The promise with the items.

      Example

      import { IDataRepository } from '@egomobile/orm'

      // keep sure to initialize your props
      // with a value, which is not (undefined)
      class User {
      id: number = -1;
      first_name: string = '';
      last_name: string = '';
      is_active: boolean | null = null;
      is_deleted: boolean = false;
      }

      async function load10ActiveUsersAndSkipFirst(repo: IDataRepository): Promise<User[]> {
      // in SQL context
      return await repo.find(User, {
      where: 'is_active=$1 AND (is_deleted=$2 OR is_deleted IS NULL)',
      params: [ true, false ], // $1, $2

      offset: 1,
      limit: 10
      })
      }
      -
    • Tries to find a simple item.

      Type Parameters

      • T extends unknown = any

      Parameters

      • type: Constructor<T>

        The class / type.

      • Optional options: Nilable<IFindOneOptions>

        The custom options.

      Returns Promise<null | T>

      The promise with the item or (null) if not found.

      Example

      import { IDataRepository } from '@egomobile/orm'

      // keep sure to initialize your props
      // with a value, which is not (undefined)
      class User {
      id: number = -1;
      first_name: string = '';
      last_name: string = '';
      is_active: boolean | null = null;
      is_deleted: boolean = false;
      }

      async function loadLastActiveUser(repo: IDataRepository): Promise<User> {
      // in SQL context
      return await repo.findOne(User, {
      where: 'is_active=$1 AND (is_deleted=$2 OR is_deleted IS NULL)',
      params: [ true, false ], // $1, $2

      sort: {
      'created': 'DESC', // first sort by 'created' (descending)
      'id': 'DESC', // then by 'id' (descending)
      'last_name': 'ASC', // then by 'last_name' (ascending)
      'first_name': 'ASC' // then by 'first_name' (ascending)
      }
      })
      }
      -
    • Insert one or more entities.

      Type Parameters

      • T extends unknown = any

      Parameters

      • entity: T

        The entity to insert.

      Returns Promise<T>

      The promise with the inserted entity/entities.

      Example

      import { IDataRepository } from '@egomobile/orm'

      // keep sure to initialize your props
      // with a value, which is not (undefined)
      class User {
      id: number | null = null;
      first_name: string = '';
      last_name: string = '';
      is_active: boolean | null = null;
      is_deleted: boolean = false;
      }

      async function createUser(repo: IDataRepository, firstName: string, lastName: string): Promise<User> {
      const newUser = new User()
      newUser.last_name = lastName
      newUser.first_name = firstName
      newUser.is_active = true

      await repo.insert(newUser)
      }
      -
    • Type Parameters

      • T extends unknown = any

      Parameters

      • entities: List<T>

      Returns Promise<T[]>

    • Type Parameters

      • T extends unknown = any

      Parameters

      • entityOrEntities: T | List<T>

      Returns Promise<T | T[]>

    • Does a raw query.

      Type Parameters

      • T extends unknown = any

      Parameters

      • q: any

        The object / value, which represents the query.

      • Optional Rest ...paramsOrArgs: any[]

        A list of optional parameters or arguments for the query.

      Returns Promise<T>

      The promise with the raw result.

      Example

      import { IDataRepository } from '@egomobile/orm'

      async function deleteInactiveUsers(repo: IDataRepository) {
      // in SQL context
      //
      // result is an object or value
      // from the underlying data adapter itself
      const result: any = await repo.query(
      "UPDATE users SET is_deleted=$1 WHERE is_active=$2;",
      false, false // $1, $2
      )
      }
      -
    • Does a raw query and maps the result(s) to entity objects. The classes do not need to be configured in context, so it is possbile to implement and work with "joins". The difference to queryAndMap() is, that is makes use of cursor pattern @@ -49,7 +49,7 @@

    Returns AsyncGenerator<T, any, unknown>

    The async generator.

    Example

    import { IDataRepository } from '@egomobile/orm'

    class UserAndRole {
    role_id!: string;
    user_id!: string;
    }

    async function loadUserRoles(repo: IDataRepository): AsyncGenerator<UserAndRole> {
    // PostgreSQL example
    // s. https://github.com/egomobile/node-orm-pg

    return repo.queryAndIterate(
    UserAndRole, // type of the target entity
    // does not need to be configured
    // in data context

    // build query
    "SELECT DISTINCT ur.id AS role_id, u.id AS user_id " +
    "FROM user_roles ur " +
    "INNER JOIN users u ON u.id = ur.user_id " +
    "WHERE u.is_active = $1 AND u.is_deleted = $2;",

    // additional parameters
    true, false // $1, $2
    )
    }

    const iterator = loadUserRoles(
    // ... your repo instance ...
    )

    for await (const userAndRole of iterator) {
    // your code ...
    }
    -
    • Does a raw query and maps the result(s) to entity objects. The classes do not need to be configured in context, so it is possbile to implement and work with "joins".

      Type Parameters

      • T extends unknown = any

      Parameters

      • type: Constructor<T>

        The target type.

        @@ -58,16 +58,16 @@

      Returns Promise<T[]>

      The promise with the mapped entities.

      Example

      import { IDataRepository } from '@egomobile/orm'

      class UserAndRole {
      role_id!: string;
      user_id!: string;
      }

      async function loadUserRoles(repo: IDataRepository): Promise<UserAndRole[]> {
      // PostgreSQL example
      // s. https://github.com/egomobile/node-orm-pg

      return await repo.queryAndMap(
      UserAndRole, // type of the target entity
      // does not need to be configured
      // in data context

      // build query
      "SELECT DISTINCT ur.id AS role_id, u.id AS user_id " +
      "FROM user_roles ur " +
      "INNER JOIN users u ON u.id = ur.user_id " +
      "WHERE u.is_active = $1 AND u.is_deleted = $2;",

      // additional parameters
      true, false // $1, $2
      )
      }
      -
    • Removes one or more entities.

      Type Parameters

      • T extends unknown = any

      Parameters

      • entity: T

        The entity to remove.

      Returns Promise<T>

      The promise with the removed entity/entities.

      Example

      import { IDataRepository } from '@egomobile/orm'

      // keep sure to initialize your props
      // with a value, which is not (undefined)
      class User {
      id: number = -1;
      is_active: boolean | null = null;
      }

      async function removeInactiveUsers(repo: IDataRepository, users: User[]) {
      const inactiveUsers = users.find(u => u.is_active === false)

      await repo.remove(inactiveUsers)
      }
      -
    • Type Parameters

      • T extends unknown = any

      Parameters

      • entities: List<T>

      Returns Promise<T[]>

    • Type Parameters

      • T extends unknown = any

      Parameters

      • entityOrEntities: T | List<T>

      Returns Promise<T | T[]>

    • Updates one or more entities.

      +

    Returns this

    Generated using TypeDoc

    \ No newline at end of file +
  • Type Parameters

    Parameters

    Returns Promise<T[]>

  • Type Parameters

    Parameters

    Returns Promise<T | T[]>

  • Generated using TypeDoc

    \ No newline at end of file diff --git a/interfaces/IDataContext.html b/interfaces/IDataContext.html index 3dbac74..b834bde 100644 --- a/interfaces/IDataContext.html +++ b/interfaces/IDataContext.html @@ -1,5 +1,5 @@ IDataContext | @egomobile/orm

    Interface IDataContext

    A data context.

    -
    interface IDataContext {
        entities: EntityConfigurations;
        noDbNull: boolean;
        count<T>(type, options?): Promise<number>;
        find<T>(type, options?): Promise<T[]>;
        findOne<T>(type, options?): Promise<null | T>;
        insert<T>(entity): Promise<T>;
        insert<T>(entities): Promise<T[]>;
        insert<T>(entityOrEntities): Promise<T | T[]>;
        query<T>(q, ...paramsOrArgs?): Promise<T>;
        queryAndIterate<T>(type, q, ...paramsOrArgs?): AsyncGenerator<T, any, unknown>;
        queryAndMap<T>(type, q, ...paramsOrArgs?): Promise<T[]>;
        remove<T>(entity): Promise<T>;
        remove<T>(entities): Promise<T[]>;
        remove<T>(entityOrEntities): Promise<T | T[]>;
        update<T>(entity): Promise<T>;
        update<T>(entities): Promise<T[]>;
        update<T>(entityOrEntities): Promise<T | T[]>;
    }

    Hierarchy (view full)

    Properties

    interface IDataContext {
        entities: EntityConfigurations;
        noDbNull: boolean;
        count<T>(type, options?): Promise<number>;
        find<T>(type, options?): Promise<T[]>;
        findOne<T>(type, options?): Promise<null | T>;
        insert<T>(entity): Promise<T>;
        insert<T>(entities): Promise<T[]>;
        insert<T>(entityOrEntities): Promise<T | T[]>;
        query<T>(q, ...paramsOrArgs?): Promise<T>;
        queryAndIterate<T>(type, q, ...paramsOrArgs?): AsyncGenerator<T, any, unknown>;
        queryAndMap<T>(type, q, ...paramsOrArgs?): Promise<T[]>;
        remove<T>(entity): Promise<T>;
        remove<T>(entities): Promise<T[]>;
        remove<T>(entityOrEntities): Promise<T | T[]>;
        update<T>(entity): Promise<T>;
        update<T>(entities): Promise<T[]>;
        update<T>(entityOrEntities): Promise<T | T[]>;
    }

    Hierarchy (view full)

    Properties

    Methods

    count find @@ -11,37 +11,37 @@ remove update

    Properties

    The list of entity configurations.

    -
    noDbNull: boolean

    Default value, which indicates if DbNull value should not be used.

    -

    Methods

    noDbNull: boolean

    Default value, which indicates if DbNull value should not be used.

    +

    Methods

    • Counts a list of items.

      Type Parameters

      • T extends unknown = any

      Parameters

      • type: Constructor<T>

        The class / type.

      • Optional options: Nilable<IFindOptions>

        The custom options.

      Returns Promise<number>

      The promise with the items.

      Example

      import { IDataRepository } from '@egomobile/orm'

      class User {
      id: number = -1;
      }

      async function countActiveUsers(repo: IDataRepository): Promise<number> {
      // in SQL context
      return await repo.count(User, {
      where: 'is_active=$1 AND (is_deleted=$2 OR is_deleted IS NULL)',
      params: [ true, false ], // $1, $2
      })
      }
      -
    • Finds a list of items.

      Type Parameters

      • T extends unknown = any

      Parameters

      • type: Constructor<T>

        The class / type.

      • Optional options: Nilable<IFindOptions>

        The custom options.

      Returns Promise<T[]>

      The promise with the items.

      Example

      import { IDataRepository } from '@egomobile/orm'

      // keep sure to initialize your props
      // with a value, which is not (undefined)
      class User {
      id: number = -1;
      first_name: string = '';
      last_name: string = '';
      is_active: boolean | null = null;
      is_deleted: boolean = false;
      }

      async function load10ActiveUsersAndSkipFirst(repo: IDataRepository): Promise<User[]> {
      // in SQL context
      return await repo.find(User, {
      where: 'is_active=$1 AND (is_deleted=$2 OR is_deleted IS NULL)',
      params: [ true, false ], // $1, $2

      offset: 1,
      limit: 10
      })
      }
      -
    • Tries to find a simple item.

      Type Parameters

      • T extends unknown = any

      Parameters

      • type: Constructor<T>

        The class / type.

      • Optional options: Nilable<IFindOneOptions>

        The custom options.

      Returns Promise<null | T>

      The promise with the item or (null) if not found.

      Example

      import { IDataRepository } from '@egomobile/orm'

      // keep sure to initialize your props
      // with a value, which is not (undefined)
      class User {
      id: number = -1;
      first_name: string = '';
      last_name: string = '';
      is_active: boolean | null = null;
      is_deleted: boolean = false;
      }

      async function loadLastActiveUser(repo: IDataRepository): Promise<User> {
      // in SQL context
      return await repo.findOne(User, {
      where: 'is_active=$1 AND (is_deleted=$2 OR is_deleted IS NULL)',
      params: [ true, false ], // $1, $2

      sort: {
      'created': 'DESC', // first sort by 'created' (descending)
      'id': 'DESC', // then by 'id' (descending)
      'last_name': 'ASC', // then by 'last_name' (ascending)
      'first_name': 'ASC' // then by 'first_name' (ascending)
      }
      })
      }
      -
    • Insert one or more entities.

      Type Parameters

      • T extends unknown = any

      Parameters

      • entity: T

        The entity to insert.

      Returns Promise<T>

      The promise with the inserted entity/entities.

      Example

      import { IDataRepository } from '@egomobile/orm'

      // keep sure to initialize your props
      // with a value, which is not (undefined)
      class User {
      id: number | null = null;
      first_name: string = '';
      last_name: string = '';
      is_active: boolean | null = null;
      is_deleted: boolean = false;
      }

      async function createUser(repo: IDataRepository, firstName: string, lastName: string): Promise<User> {
      const newUser = new User()
      newUser.last_name = lastName
      newUser.first_name = firstName
      newUser.is_active = true

      await repo.insert(newUser)
      }
      -
    • Type Parameters

      • T extends unknown = any

      Parameters

      • entities: List<T>

      Returns Promise<T[]>

    • Type Parameters

      • T extends unknown = any

      Parameters

      • entityOrEntities: T | List<T>

      Returns Promise<T | T[]>

    • Does a raw query.

      Type Parameters

      • T extends unknown = any

      Parameters

      • q: any

        The object / value, which represents the query.

      • Optional Rest ...paramsOrArgs: any[]

        A list of optional parameters or arguments for the query.

      Returns Promise<T>

      The promise with the raw result.

      Example

      import { IDataRepository } from '@egomobile/orm'

      async function deleteInactiveUsers(repo: IDataRepository) {
      // in SQL context
      //
      // result is an object or value
      // from the underlying data adapter itself
      const result: any = await repo.query(
      "UPDATE users SET is_deleted=$1 WHERE is_active=$2;",
      false, false // $1, $2
      )
      }
      -
    • Does a raw query and maps the result(s) to entity objects. The classes do not need to be configured in context, so it is possbile to implement and work with "joins". The difference to queryAndMap() is, that is makes use of cursor pattern @@ -52,7 +52,7 @@

    Returns AsyncGenerator<T, any, unknown>

    The async generator.

    Example

    import { IDataRepository } from '@egomobile/orm'

    class UserAndRole {
    role_id!: string;
    user_id!: string;
    }

    async function loadUserRoles(repo: IDataRepository): AsyncGenerator<UserAndRole> {
    // PostgreSQL example
    // s. https://github.com/egomobile/node-orm-pg

    return repo.queryAndIterate(
    UserAndRole, // type of the target entity
    // does not need to be configured
    // in data context

    // build query
    "SELECT DISTINCT ur.id AS role_id, u.id AS user_id " +
    "FROM user_roles ur " +
    "INNER JOIN users u ON u.id = ur.user_id " +
    "WHERE u.is_active = $1 AND u.is_deleted = $2;",

    // additional parameters
    true, false // $1, $2
    )
    }

    const iterator = loadUserRoles(
    // ... your repo instance ...
    )

    for await (const userAndRole of iterator) {
    // your code ...
    }
    -
    • Does a raw query and maps the result(s) to entity objects. The classes do not need to be configured in context, so it is possbile to implement and work with "joins".

      Type Parameters

      • T extends unknown = any

      Parameters

      • type: Constructor<T>

        The target type.

        @@ -61,14 +61,14 @@

      Returns Promise<T[]>

      The promise with the mapped entities.

      Example

      import { IDataRepository } from '@egomobile/orm'

      class UserAndRole {
      role_id!: string;
      user_id!: string;
      }

      async function loadUserRoles(repo: IDataRepository): Promise<UserAndRole[]> {
      // PostgreSQL example
      // s. https://github.com/egomobile/node-orm-pg

      return await repo.queryAndMap(
      UserAndRole, // type of the target entity
      // does not need to be configured
      // in data context

      // build query
      "SELECT DISTINCT ur.id AS role_id, u.id AS user_id " +
      "FROM user_roles ur " +
      "INNER JOIN users u ON u.id = ur.user_id " +
      "WHERE u.is_active = $1 AND u.is_deleted = $2;",

      // additional parameters
      true, false // $1, $2
      )
      }
      -
    • Removes one or more entities.

      Type Parameters

      • T extends unknown = any

      Parameters

      • entity: T

        The entity to remove.

      Returns Promise<T>

      The promise with the removed entity/entities.

      Example

      import { IDataRepository } from '@egomobile/orm'

      // keep sure to initialize your props
      // with a value, which is not (undefined)
      class User {
      id: number = -1;
      is_active: boolean | null = null;
      }

      async function removeInactiveUsers(repo: IDataRepository, users: User[]) {
      const inactiveUsers = users.find(u => u.is_active === false)

      await repo.remove(inactiveUsers)
      }
      -
    • Type Parameters

      • T extends unknown = any

      Parameters

      • entities: List<T>

      Returns Promise<T[]>

    • Type Parameters

      • T extends unknown = any

      Parameters

      • entityOrEntities: T | List<T>

      Returns Promise<T | T[]>

    • Updates one or more entities.

      Type Parameters

      • T extends unknown = any

      Parameters

      • entity: T

        The entity to update.

      Returns Promise<T>

      The promise with the updated entity/entities.

      Example

      import { IDataRepository } from '@egomobile/orm'

      // keep sure to initialize your props
      // with a value, which is not (undefined)
      class User {
      id: number = -1;
      is_deleted: boolean = false;
      }

      async function deleteUsers(repo: IDataRepository, users: User[]) {
      users.forEach((user) => {
      user.is_deleted = true
      })

      await repo.update(inactiveUsers)
      }
      -
    • Type Parameters

      • T extends unknown = any

      Parameters

      • entities: List<T>

      Returns Promise<T[]>

    • Type Parameters

      • T extends unknown = any

      Parameters

      • entityOrEntities: T | List<T>

      Returns Promise<T | T[]>

    Generated using TypeDoc

    \ No newline at end of file +
  • Type Parameters

    Parameters

    Returns Promise<T[]>

  • Type Parameters

    Parameters

    Returns Promise<T | T[]>

  • Generated using TypeDoc

    \ No newline at end of file diff --git a/interfaces/IDataContextOptions.html b/interfaces/IDataContextOptions.html index 4e434d9..927fa08 100644 --- a/interfaces/IDataContextOptions.html +++ b/interfaces/IDataContextOptions.html @@ -1,10 +1,10 @@ IDataContextOptions | @egomobile/orm

    Interface IDataContextOptions

    Options for a data context.

    -
    interface IDataContextOptions {
        adapter: IDataAdapter;
        entities: EntityConfigurations;
        noDbNull?: Nilable<boolean>;
    }

    Hierarchy (view full)

    Properties

    interface IDataContextOptions {
        adapter: IDataAdapter;
        entities: EntityConfigurations;
        noDbNull?: Nilable<boolean>;
    }

    Hierarchy (view full)

    Properties

    adapter: IDataAdapter

    The data adapter to use.

    -

    The configurations of all entities / tables.

    -
    noDbNull?: Nilable<boolean>

    Indicates that the special value NULL should not be used +

    The configurations of all entities / tables.

    +
    noDbNull?: Nilable<boolean>

    Indicates that the special value NULL should not be used by default.

    Default

    false

    -

    Generated using TypeDoc

    \ No newline at end of file +

    Generated using TypeDoc

    \ No newline at end of file diff --git a/interfaces/IDataRepository.html b/interfaces/IDataRepository.html index bc221ad..412264d 100644 --- a/interfaces/IDataRepository.html +++ b/interfaces/IDataRepository.html @@ -1,5 +1,5 @@ IDataRepository | @egomobile/orm

    Interface IDataRepository

    A data repository.

    -
    interface IDataRepository {
        count<T>(type, options?): Promise<number>;
        find<T>(type, options?): Promise<T[]>;
        findOne<T>(type, options?): Promise<null | T>;
        insert<T>(entity): Promise<T>;
        insert<T>(entities): Promise<T[]>;
        insert<T>(entityOrEntities): Promise<T | T[]>;
        query<T>(q, ...paramsOrArgs?): Promise<T>;
        queryAndIterate<T>(type, q, ...paramsOrArgs?): AsyncGenerator<T, any, unknown>;
        queryAndMap<T>(type, q, ...paramsOrArgs?): Promise<T[]>;
        remove<T>(entity): Promise<T>;
        remove<T>(entities): Promise<T[]>;
        remove<T>(entityOrEntities): Promise<T | T[]>;
        update<T>(entity): Promise<T>;
        update<T>(entities): Promise<T[]>;
        update<T>(entityOrEntities): Promise<T | T[]>;
    }

    Hierarchy (view full)

    Methods

    interface IDataRepository {
        count<T>(type, options?): Promise<number>;
        find<T>(type, options?): Promise<T[]>;
        findOne<T>(type, options?): Promise<null | T>;
        insert<T>(entity): Promise<T>;
        insert<T>(entities): Promise<T[]>;
        insert<T>(entityOrEntities): Promise<T | T[]>;
        query<T>(q, ...paramsOrArgs?): Promise<T>;
        queryAndIterate<T>(type, q, ...paramsOrArgs?): AsyncGenerator<T, any, unknown>;
        queryAndMap<T>(type, q, ...paramsOrArgs?): Promise<T[]>;
        remove<T>(entity): Promise<T>;
        remove<T>(entities): Promise<T[]>;
        remove<T>(entityOrEntities): Promise<T | T[]>;
        update<T>(entity): Promise<T>;
        update<T>(entities): Promise<T[]>;
        update<T>(entityOrEntities): Promise<T | T[]>;
    }

    Hierarchy (view full)

    Methods

    count find findOne insert @@ -14,30 +14,30 @@

    Returns Promise<number>

    The promise with the items.

    Example

    import { IDataRepository } from '@egomobile/orm'

    class User {
    id: number = -1;
    }

    async function countActiveUsers(repo: IDataRepository): Promise<number> {
    // in SQL context
    return await repo.count(User, {
    where: 'is_active=$1 AND (is_deleted=$2 OR is_deleted IS NULL)',
    params: [ true, false ], // $1, $2
    })
    }
    -
    • Finds a list of items.

      Type Parameters

      • T extends unknown = any

      Parameters

      • type: Constructor<T>

        The class / type.

      • Optional options: Nilable<IFindOptions>

        The custom options.

      Returns Promise<T[]>

      The promise with the items.

      Example

      import { IDataRepository } from '@egomobile/orm'

      // keep sure to initialize your props
      // with a value, which is not (undefined)
      class User {
      id: number = -1;
      first_name: string = '';
      last_name: string = '';
      is_active: boolean | null = null;
      is_deleted: boolean = false;
      }

      async function load10ActiveUsersAndSkipFirst(repo: IDataRepository): Promise<User[]> {
      // in SQL context
      return await repo.find(User, {
      where: 'is_active=$1 AND (is_deleted=$2 OR is_deleted IS NULL)',
      params: [ true, false ], // $1, $2

      offset: 1,
      limit: 10
      })
      }
      -
    • Tries to find a simple item.

      Type Parameters

      • T extends unknown = any

      Parameters

      • type: Constructor<T>

        The class / type.

      • Optional options: Nilable<IFindOneOptions>

        The custom options.

      Returns Promise<null | T>

      The promise with the item or (null) if not found.

      Example

      import { IDataRepository } from '@egomobile/orm'

      // keep sure to initialize your props
      // with a value, which is not (undefined)
      class User {
      id: number = -1;
      first_name: string = '';
      last_name: string = '';
      is_active: boolean | null = null;
      is_deleted: boolean = false;
      }

      async function loadLastActiveUser(repo: IDataRepository): Promise<User> {
      // in SQL context
      return await repo.findOne(User, {
      where: 'is_active=$1 AND (is_deleted=$2 OR is_deleted IS NULL)',
      params: [ true, false ], // $1, $2

      sort: {
      'created': 'DESC', // first sort by 'created' (descending)
      'id': 'DESC', // then by 'id' (descending)
      'last_name': 'ASC', // then by 'last_name' (ascending)
      'first_name': 'ASC' // then by 'first_name' (ascending)
      }
      })
      }
      -
    • Insert one or more entities.

      Type Parameters

      • T extends unknown = any

      Parameters

      • entity: T

        The entity to insert.

      Returns Promise<T>

      The promise with the inserted entity/entities.

      Example

      import { IDataRepository } from '@egomobile/orm'

      // keep sure to initialize your props
      // with a value, which is not (undefined)
      class User {
      id: number | null = null;
      first_name: string = '';
      last_name: string = '';
      is_active: boolean | null = null;
      is_deleted: boolean = false;
      }

      async function createUser(repo: IDataRepository, firstName: string, lastName: string): Promise<User> {
      const newUser = new User()
      newUser.last_name = lastName
      newUser.first_name = firstName
      newUser.is_active = true

      await repo.insert(newUser)
      }
      -
    • Type Parameters

      • T extends unknown = any

      Parameters

      • entities: List<T>

      Returns Promise<T[]>

    • Type Parameters

      • T extends unknown = any

      Parameters

      • entityOrEntities: T | List<T>

      Returns Promise<T | T[]>

    • Does a raw query.

      +
    • Type Parameters

      • T extends unknown = any

      Parameters

      • entities: List<T>

      Returns Promise<T[]>

    • Type Parameters

      • T extends unknown = any

      Parameters

      • entityOrEntities: T | List<T>

      Returns Promise<T | T[]>

    • Does a raw query.

      Type Parameters

      • T extends unknown = any

      Parameters

      • q: any

        The object / value, which represents the query.

      • Optional Rest ...paramsOrArgs: any[]

        A list of optional parameters or arguments for the query.

      Returns Promise<T>

      The promise with the raw result.

      Example

      import { IDataRepository } from '@egomobile/orm'

      async function deleteInactiveUsers(repo: IDataRepository) {
      // in SQL context
      //
      // result is an object or value
      // from the underlying data adapter itself
      const result: any = await repo.query(
      "UPDATE users SET is_deleted=$1 WHERE is_active=$2;",
      false, false // $1, $2
      )
      }
      -
    • Does a raw query and maps the result(s) to entity objects. +

    • Does a raw query and maps the result(s) to entity objects. The classes do not need to be configured in context, so it is possbile to implement and work with "joins". The difference to queryAndMap() is, that is makes use of cursor pattern @@ -48,7 +48,7 @@

    Returns AsyncGenerator<T, any, unknown>

    The async generator.

    Example

    import { IDataRepository } from '@egomobile/orm'

    class UserAndRole {
    role_id!: string;
    user_id!: string;
    }

    async function loadUserRoles(repo: IDataRepository): AsyncGenerator<UserAndRole> {
    // PostgreSQL example
    // s. https://github.com/egomobile/node-orm-pg

    return repo.queryAndIterate(
    UserAndRole, // type of the target entity
    // does not need to be configured
    // in data context

    // build query
    "SELECT DISTINCT ur.id AS role_id, u.id AS user_id " +
    "FROM user_roles ur " +
    "INNER JOIN users u ON u.id = ur.user_id " +
    "WHERE u.is_active = $1 AND u.is_deleted = $2;",

    // additional parameters
    true, false // $1, $2
    )
    }

    const iterator = loadUserRoles(
    // ... your repo instance ...
    )

    for await (const userAndRole of iterator) {
    // your code ...
    }
    -
    • Does a raw query and maps the result(s) to entity objects. +

    • Does a raw query and maps the result(s) to entity objects. The classes do not need to be configured in context, so it is possbile to implement and work with "joins".

      Type Parameters

      • T extends unknown = any

      Parameters

      • type: Constructor<T>

        The target type.

        @@ -57,14 +57,14 @@

      Returns Promise<T[]>

      The promise with the mapped entities.

      Example

      import { IDataRepository } from '@egomobile/orm'

      class UserAndRole {
      role_id!: string;
      user_id!: string;
      }

      async function loadUserRoles(repo: IDataRepository): Promise<UserAndRole[]> {
      // PostgreSQL example
      // s. https://github.com/egomobile/node-orm-pg

      return await repo.queryAndMap(
      UserAndRole, // type of the target entity
      // does not need to be configured
      // in data context

      // build query
      "SELECT DISTINCT ur.id AS role_id, u.id AS user_id " +
      "FROM user_roles ur " +
      "INNER JOIN users u ON u.id = ur.user_id " +
      "WHERE u.is_active = $1 AND u.is_deleted = $2;",

      // additional parameters
      true, false // $1, $2
      )
      }
      -
    • Removes one or more entities.

      Type Parameters

      • T extends unknown = any

      Parameters

      • entity: T

        The entity to remove.

      Returns Promise<T>

      The promise with the removed entity/entities.

      Example

      import { IDataRepository } from '@egomobile/orm'

      // keep sure to initialize your props
      // with a value, which is not (undefined)
      class User {
      id: number = -1;
      is_active: boolean | null = null;
      }

      async function removeInactiveUsers(repo: IDataRepository, users: User[]) {
      const inactiveUsers = users.find(u => u.is_active === false)

      await repo.remove(inactiveUsers)
      }
      -
    • Type Parameters

      • T extends unknown = any

      Parameters

      • entities: List<T>

      Returns Promise<T[]>

    • Type Parameters

      • T extends unknown = any

      Parameters

      • entityOrEntities: T | List<T>

      Returns Promise<T | T[]>

    • Updates one or more entities.

      +
    • Type Parameters

      • T extends unknown = any

      Parameters

      • entities: List<T>

      Returns Promise<T[]>

    • Type Parameters

      • T extends unknown = any

      Parameters

      • entityOrEntities: T | List<T>

      Returns Promise<T | T[]>

    • Updates one or more entities.

      Type Parameters

      • T extends unknown = any

      Parameters

      • entity: T

        The entity to update.

      Returns Promise<T>

      The promise with the updated entity/entities.

      Example

      import { IDataRepository } from '@egomobile/orm'

      // keep sure to initialize your props
      // with a value, which is not (undefined)
      class User {
      id: number = -1;
      is_deleted: boolean = false;
      }

      async function deleteUsers(repo: IDataRepository, users: User[]) {
      users.forEach((user) => {
      user.is_deleted = true
      })

      await repo.update(inactiveUsers)
      }
      -
    • Type Parameters

      • T extends unknown = any

      Parameters

      • entities: List<T>

      Returns Promise<T[]>

    • Type Parameters

      • T extends unknown = any

      Parameters

      • entityOrEntities: T | List<T>

      Returns Promise<T | T[]>

    Generated using TypeDoc

    \ No newline at end of file +
  • Type Parameters

    Parameters

    Returns Promise<T[]>

  • Type Parameters

    Parameters

    Returns Promise<T | T[]>

  • Generated using TypeDoc

    \ No newline at end of file diff --git a/interfaces/IEntityConfig.html b/interfaces/IEntityConfig.html index 72c518d..891d131 100644 --- a/interfaces/IEntityConfig.html +++ b/interfaces/IEntityConfig.html @@ -1,13 +1,13 @@ IEntityConfig | @egomobile/orm

    Interface IEntityConfig<TEntity>

    A configuration for an entity.

    -
    interface IEntityConfig<TEntity> {
        comment?: Nilable<string>;
        fields?: Nilable<EntityFieldConfigurations>;
        ids?: Nilable<string[]>;
        noDbNull?: Nilable<boolean>;
        type: Constructor<TEntity>;
    }

    Type Parameters

    • TEntity extends unknown = any

    Properties

    interface IEntityConfig<TEntity> {
        comment?: Nilable<string>;
        fields?: Nilable<EntityFieldConfigurations<any>>;
        ids?: Nilable<string[]>;
        noDbNull?: Nilable<boolean>;
        type: Constructor<TEntity>;
    }

    Type Parameters

    • TEntity extends unknown = any

    Properties

    comment?: Nilable<string>

    A comment (or description) for this entity, which can be used as documentation later, e.g.

    -
    fields?: Nilable<EntityFieldConfigurations>

    The custom field configurations.

    -
    ids?: Nilable<string[]>

    List of columns / fields which representthe ID.

    -
    noDbNull?: Nilable<boolean>

    Indicates that the special value NULL should not be used +

    fields?: Nilable<EntityFieldConfigurations<any>>

    The custom field configurations.

    +
    ids?: Nilable<string[]>

    List of columns / fields which representthe ID.

    +
    noDbNull?: Nilable<boolean>

    Indicates that the special value NULL should not be used for this entity.

    -
    type: Constructor<TEntity>

    The class / type to use to create instances for an entity.

    -

    Generated using TypeDoc

    \ No newline at end of file +
    type: Constructor<TEntity>

    The class / type to use to create instances for an entity.

    +

    Generated using TypeDoc

    \ No newline at end of file diff --git a/interfaces/IEntityFieldConfig.html b/interfaces/IEntityFieldConfig.html index d22882a..588e4c9 100644 --- a/interfaces/IEntityFieldConfig.html +++ b/interfaces/IEntityFieldConfig.html @@ -1,6 +1,6 @@ IEntityFieldConfig | @egomobile/orm

    Interface IEntityFieldConfig

    A configuration for an entity field.

    -
    interface IEntityFieldConfig {
        comment?: Nilable<string>;
        transformer?: Nilable<IEntityFieldTransformer>;
    }

    Properties

    interface IEntityFieldConfig {
        comment?: Nilable<string>;
        transformer?: Nilable<IEntityFieldTransformer>;
    }

    Properties

    comment?: Nilable<string>

    A comment (or description) for this field, which can be used as documentation later, e.g.

    -
    transformer?: Nilable<IEntityFieldTransformer>

    The custom and optional data transformer.

    -

    Generated using TypeDoc

    \ No newline at end of file +
    transformer?: Nilable<IEntityFieldTransformer>

    The custom and optional data transformer.

    +

    Generated using TypeDoc

    \ No newline at end of file diff --git a/interfaces/IEntityFieldTransformer.html b/interfaces/IEntityFieldTransformer.html index b049242..bbb1ac8 100644 --- a/interfaces/IEntityFieldTransformer.html +++ b/interfaces/IEntityFieldTransformer.html @@ -1,9 +1,9 @@ IEntityFieldTransformer | @egomobile/orm

    Interface IEntityFieldTransformer

    An object, which transforms the data of a field.

    -
    interface IEntityFieldTransformer {
        from?: Nilable<DataTransformer>;
        to?: Nilable<DataTransformer>;
    }

    Properties

    interface IEntityFieldTransformer {
        from?: Nilable<DataTransformer>;
        to?: Nilable<DataTransformer>;
    }

    Properties

    Properties

    from?: Nilable<DataTransformer>

    The optional action to invoke, when data comes from database to entity.

    -
    to?: Nilable<DataTransformer>

    The optional action to invoke, when +

    to?: Nilable<DataTransformer>

    The optional action to invoke, when data of an entity field is written to database.

    -

    Generated using TypeDoc

    \ No newline at end of file +

    Generated using TypeDoc

    \ No newline at end of file diff --git a/interfaces/IEntityInfo.html b/interfaces/IEntityInfo.html index 763923c..911a9c0 100644 --- a/interfaces/IEntityInfo.html +++ b/interfaces/IEntityInfo.html @@ -1,8 +1,8 @@ IEntityInfo | @egomobile/orm

    Interface IEntityInfo

    Result of a DataAdapterBase.getEntityByType() call.

    -
    interface IEntityInfo {
        config: IEntityConfig<any>;
        name: string;
        noDbNull: boolean;
    }

    Properties

    interface IEntityInfo {
        config: IEntityConfig<any>;
        name: string;
        noDbNull: boolean;
    }

    Properties

    Properties

    config: IEntityConfig<any>

    The underlying config.

    -
    name: string

    The name.

    -
    noDbNull: boolean

    Values, that indicates, if DbNull should be used or not.

    -

    Generated using TypeDoc

    \ No newline at end of file +
    name: string

    The name.

    +
    noDbNull: boolean

    Values, that indicates, if DbNull should be used or not.

    +

    Generated using TypeDoc

    \ No newline at end of file diff --git a/interfaces/IFindOneOptions.html b/interfaces/IFindOneOptions.html index 742cea9..39f93d3 100644 --- a/interfaces/IFindOneOptions.html +++ b/interfaces/IFindOneOptions.html @@ -1,12 +1,12 @@ IFindOneOptions | @egomobile/orm

    Interface IFindOneOptions

    Options for finding one single entity.

    -
    interface IFindOneOptions {
        fields?: Nilable<any[]>;
        offset?: Nilable<number>;
        params?: any;
        sort?: any;
        where?: any;
    }

    Hierarchy (view full)

    Properties

    interface IFindOneOptions {
        fields?: Nilable<any[]>;
        offset?: Nilable<number>;
        params?: any;
        sort?: any;
        where?: any;
    }

    Hierarchy (view full)

    Properties

    fields?: Nilable<any[]>

    Custom list of fields / columns.

    -
    offset?: Nilable<number>

    The number of items to skip. Default: 0

    -
    params?: any

    An object that represents the parameters for the 'where' part.

    -
    sort?: any

    An object, which is used to sort the result.

    -
    where?: any

    An object, which is used to filter the result.

    -

    Generated using TypeDoc

    \ No newline at end of file +
    offset?: Nilable<number>

    The number of items to skip. Default: 0

    +
    params?: any

    An object that represents the parameters for the 'where' part.

    +
    sort?: any

    An object, which is used to sort the result.

    +
    where?: any

    An object, which is used to filter the result.

    +

    Generated using TypeDoc

    \ No newline at end of file diff --git a/interfaces/IFindOptions.html b/interfaces/IFindOptions.html index 9c10ca4..122d88d 100644 --- a/interfaces/IFindOptions.html +++ b/interfaces/IFindOptions.html @@ -1,14 +1,14 @@ IFindOptions | @egomobile/orm

    Interface IFindOptions

    Options for finding entities.

    -
    interface IFindOptions {
        fields?: Nilable<any[]>;
        limit?: Nilable<number>;
        offset?: Nilable<number>;
        params?: any;
        sort?: any;
        where?: any;
    }

    Hierarchy (view full)

    Properties

    interface IFindOptions {
        fields?: Nilable<any[]>;
        limit?: Nilable<number>;
        offset?: Nilable<number>;
        params?: any;
        sort?: any;
        where?: any;
    }

    Hierarchy (view full)

    Properties

    fields?: Nilable<any[]>

    Custom list of fields / columns.

    -
    limit?: Nilable<number>

    The maximum number of items. Default: no limit

    -
    offset?: Nilable<number>

    The number of items to skip. Default: 0

    -
    params?: any

    An object that represents the parameters for the 'where' part.

    -
    sort?: any

    An object, which is used to sort the result.

    -
    where?: any

    An object, which is used to filter the result.

    -

    Generated using TypeDoc

    \ No newline at end of file +
    limit?: Nilable<number>

    The maximum number of items. Default: no limit

    +
    offset?: Nilable<number>

    The number of items to skip. Default: 0

    +
    params?: any

    An object that represents the parameters for the 'where' part.

    +
    sort?: any

    An object, which is used to sort the result.

    +
    where?: any

    An object, which is used to filter the result.

    +

    Generated using TypeDoc

    \ No newline at end of file diff --git a/interfaces/IVerifyEntityConfigurationsActionContext.html b/interfaces/IVerifyEntityConfigurationsActionContext.html index d5bf6dd..e149f5f 100644 --- a/interfaces/IVerifyEntityConfigurationsActionContext.html +++ b/interfaces/IVerifyEntityConfigurationsActionContext.html @@ -1,8 +1,8 @@ IVerifyEntityConfigurationsActionContext | @egomobile/orm

    Interface IVerifyEntityConfigurationsActionContext<TConfig>

    A context for a VerifyEntityConfigurationsAction function.

    -
    interface IVerifyEntityConfigurationsActionContext<TConfig> {
        entity: {
            config: TConfig[keyof TConfig];
            name: keyof TConfig;
        };
        validationError?: Nilable<string>;
    }

    Type Parameters

    Properties

    interface IVerifyEntityConfigurationsActionContext<TConfig> {
        entity: {
            config: TConfig[keyof TConfig];
            name: keyof TConfig;
        };
        validationError?: Nilable<string>;
    }

    Type Parameters

    Properties

    entity: {
        config: TConfig[keyof TConfig];
        name: keyof TConfig;
    }

    The current entity.

    Type declaration

    validationError?: Nilable<string>

    A non-empty value that represents a validation error.

    -

    Generated using TypeDoc

    \ No newline at end of file +
    validationError?: Nilable<string>

    A non-empty value that represents a validation error.

    +

    Generated using TypeDoc

    \ No newline at end of file diff --git a/interfaces/IVerifyEntityConfigurationsOptions.html b/interfaces/IVerifyEntityConfigurationsOptions.html index 8eafc89..5f81279 100644 --- a/interfaces/IVerifyEntityConfigurationsOptions.html +++ b/interfaces/IVerifyEntityConfigurationsOptions.html @@ -1,4 +1,4 @@ IVerifyEntityConfigurationsOptions | @egomobile/orm

    Interface IVerifyEntityConfigurationsOptions<TConfig>

    Options for verifyEntityConfigurations() function.

    -
    interface IVerifyEntityConfigurationsOptions<TConfig> {
        configurations: TConfig;
    }

    Type Parameters

    Hierarchy (view full)

    Properties

    interface IVerifyEntityConfigurationsOptions<TConfig> {
        configurations: TConfig;
    }

    Type Parameters

    Hierarchy (view full)

    Properties

    Properties

    configurations: TConfig

    The configuration.

    -

    Generated using TypeDoc

    \ No newline at end of file +

    Generated using TypeDoc

    \ No newline at end of file diff --git a/interfaces/IVerifyForStrictEntityDocumentationOptions.html b/interfaces/IVerifyForStrictEntityDocumentationOptions.html index f7c79de..42591e2 100644 --- a/interfaces/IVerifyForStrictEntityDocumentationOptions.html +++ b/interfaces/IVerifyForStrictEntityDocumentationOptions.html @@ -1,4 +1,4 @@ IVerifyForStrictEntityDocumentationOptions | @egomobile/orm

    Interface IVerifyForStrictEntityDocumentationOptions<TConfig>

    Options for verifyForStrictEntityDocumentation() function.

    -
    interface IVerifyForStrictEntityDocumentationOptions<TConfig> {
        configurations: TConfig;
    }

    Type Parameters

    Hierarchy (view full)

    Properties

    interface IVerifyForStrictEntityDocumentationOptions<TConfig> {
        configurations: TConfig;
    }

    Type Parameters

    Hierarchy (view full)

    Properties

    Properties

    configurations: TConfig

    The configuration.

    -

    Generated using TypeDoc

    \ No newline at end of file +

    Generated using TypeDoc

    \ No newline at end of file diff --git a/types/AsyncVerifyEntityConfigurationsAction.html b/types/AsyncVerifyEntityConfigurationsAction.html index be0cb56..4cdd29e 100644 --- a/types/AsyncVerifyEntityConfigurationsAction.html +++ b/types/AsyncVerifyEntityConfigurationsAction.html @@ -1,2 +1,2 @@ AsyncVerifyEntityConfigurationsAction | @egomobile/orm

    Type alias AsyncVerifyEntityConfigurationsAction<TConfig>

    AsyncVerifyEntityConfigurationsAction<TConfig>: ((context) => PromiseLike<void>)

    An async action used by verifyEntityConfigurations() function.

    -

    Type Parameters

    Type declaration

    Generated using TypeDoc

    \ No newline at end of file +

    Type Parameters

    Type declaration

    Generated using TypeDoc

    \ No newline at end of file diff --git a/types/DataTransformer.html b/types/DataTransformer.html index 8660515..5ce8de4 100644 --- a/types/DataTransformer.html +++ b/types/DataTransformer.html @@ -1,4 +1,4 @@ DataTransformer | @egomobile/orm

    Type alias DataTransformer

    DataTransformer: ((value) => any)

    An action, which transforms data.

    Type declaration

      • (value): any
      • Parameters

        • value: any

          The input value.

        Returns any

    Returns

    The output value.

    -

    Generated using TypeDoc

    \ No newline at end of file +

    Generated using TypeDoc

    \ No newline at end of file diff --git a/types/EntityConfigurations.html b/types/EntityConfigurations.html index efd355c..1f23b27 100644 --- a/types/EntityConfigurations.html +++ b/types/EntityConfigurations.html @@ -1,3 +1,3 @@ EntityConfigurations | @egomobile/orm

    Type alias EntityConfigurations

    EntityConfigurations: {
        [entityName: string]: IEntityConfig;
    }

    Object with entity configurations.

    Type declaration

    • [entityName: string]: IEntityConfig

      List of IEntityConfigs grouped by their entity / table names.

      -

    Generated using TypeDoc

    \ No newline at end of file +

    Generated using TypeDoc

    \ No newline at end of file diff --git a/types/EntityFieldConfigurations.html b/types/EntityFieldConfigurations.html index cb760b2..02ac1c6 100644 --- a/types/EntityFieldConfigurations.html +++ b/types/EntityFieldConfigurations.html @@ -1,3 +1,2 @@ -EntityFieldConfigurations | @egomobile/orm

    Type alias EntityFieldConfigurations

    EntityFieldConfigurations: {
        [fieldName: string]: IEntityFieldConfig;
    }

    Object with entity configurations.

    -

    Type declaration

    • [fieldName: string]: IEntityFieldConfig

      List of IEntityFieldConfigs grouped by their attribute / column names.

      -

    Generated using TypeDoc

    \ No newline at end of file +EntityFieldConfigurations | @egomobile/orm

    Type alias EntityFieldConfigurations<TEntity>

    EntityFieldConfigurations<TEntity>: Record<keyof TEntity, IEntityFieldConfig>

    Object with entity configurations.

    +

    Type Parameters

    • TEntity extends unknown = any

    Generated using TypeDoc

    \ No newline at end of file diff --git a/types/Nullable.html b/types/Nullable.html index 4dc3180..f179f72 100644 --- a/types/Nullable.html +++ b/types/Nullable.html @@ -1,2 +1,2 @@ Nullable | @egomobile/orm

    Type alias Nullable<T>

    Nullable<T>: T | typeof NULL

    A data(-base) value, which can also be (null) or something like that.

    -

    Type Parameters

    • T extends any = any

    Generated using TypeDoc

    \ No newline at end of file +

    Type Parameters

    Generated using TypeDoc

    \ No newline at end of file diff --git a/types/SyncVerifyEntityConfigurationsAction.html b/types/SyncVerifyEntityConfigurationsAction.html index 9deb737..ce5d788 100644 --- a/types/SyncVerifyEntityConfigurationsAction.html +++ b/types/SyncVerifyEntityConfigurationsAction.html @@ -1,2 +1,2 @@ SyncVerifyEntityConfigurationsAction | @egomobile/orm

    Type alias SyncVerifyEntityConfigurationsAction<TConfig>

    SyncVerifyEntityConfigurationsAction<TConfig>: ((context) => void)

    An sync action used by verifyEntityConfigurations() function.

    -

    Type Parameters

    Type declaration

    Generated using TypeDoc

    \ No newline at end of file +

    Type Parameters

    Type declaration

    Generated using TypeDoc

    \ No newline at end of file diff --git a/types/VerifyEntityConfigurationsAction.html b/types/VerifyEntityConfigurationsAction.html index eb12c8a..1e5500b 100644 --- a/types/VerifyEntityConfigurationsAction.html +++ b/types/VerifyEntityConfigurationsAction.html @@ -1,2 +1,2 @@ VerifyEntityConfigurationsAction | @egomobile/orm

    Type alias VerifyEntityConfigurationsAction<TConfig>

    Possible value for an action used by verifyEntityConfigurations() function.

    -

    Type Parameters

    Generated using TypeDoc

    \ No newline at end of file +

    Type Parameters

    Generated using TypeDoc

    \ No newline at end of file diff --git a/variables/NULL.html b/variables/NULL.html index 5dcea5e..f787f40 100644 --- a/variables/NULL.html +++ b/variables/NULL.html @@ -1,2 +1,2 @@ NULL | @egomobile/orm

    Variable NULLConst

    NULL: typeof NULL = ...

    An unique value, which represents

    -

    Generated using TypeDoc

    \ No newline at end of file +

    Generated using TypeDoc

    \ No newline at end of file