0.34.0 • Published 2 months ago

@accounts/typeorm v0.34.0

Weekly downloads
217
License
MIT
Repository
github
Last release
2 months ago

@accounts/typeorm

TypeORM adaptor for accounts

npm MIT License

Note

This package is under active development.

Install

yarn add @accounts/typeorm

Usage

import { createConnection } from 'typeorm';
import { AccountsServer } from '@accounts/server';
import { AccountsTypeorm, entities } from '@accounts/typeorm';

createConnection({
  type: 'postgres',
  url: 'postgres://user@localhost:5432/dbname',
  entities,
}).then(() => {
  const accountsTypeorm = new Typeorm();
  const accountsServer = new AccountsServer({ db: accountsTypeorm });
});

Options

type Options = {
  cache?: undefined | number; // Cache results from database (in ms)
  connection?: Connection; // Pass a connection instance
  connectionName?: string; // Use a connection name (if other than "default")
  userEntity?: typeof User; // Overwrite entities with your own
  userServiceEntity?: typeof UserService;
  userEmailEntity?: typeof UserEmail;
  userSessionEntity?: typeof UserSession;
};

Extending entities

If you want to add fields, etc. to the User entity you can, by extending the base entities.

import { User as AccountsUser } from '@accounts/typeorm';

@Entity()
export class User extends AccountsUser {
  // Add fields
  @Column()
  custom_field: string;

  // Overwrite fields
  @Colum('text')
  profile: string;
}
0.34.0

8 months ago

0.33.1

3 years ago

0.33.0

3 years ago

0.32.0

3 years ago

0.31.1

3 years ago

0.31.0

3 years ago

0.30.0

3 years ago

0.30.0-alpha.1

4 years ago

0.29.0

4 years ago

0.28.0

4 years ago

0.28.0-alpha.1

4 years ago

0.28.0-alpha.0

4 years ago

0.27.0

4 years ago

0.26.0

4 years ago

0.25.4

4 years ago

0.25.3

4 years ago

0.26.0-alpha.4

4 years ago

0.26.0-alpha.3

4 years ago

0.26.0-alpha.2

4 years ago

0.26.0-alpha.1

4 years ago

0.26.0-alpha.0

4 years ago

0.25.1

4 years ago

0.25.0

4 years ago

0.24.0

4 years ago

0.23.0

4 years ago

0.22.0

4 years ago

0.21.1

4 years ago

0.21.0

4 years ago

0.20.1

4 years ago

0.20.0

4 years ago

0.19.0

5 years ago

0.18.0

5 years ago

0.17.0

5 years ago

0.16.0

5 years ago

0.15.0

5 years ago

0.14.0

5 years ago

0.13.0

5 years ago

0.12.0

5 years ago

0.11.2

5 years ago

0.11.1

5 years ago

0.9.3

5 years ago

0.10.0

5 years ago