How to use @nestjs/azure-database - 4 common examples

To help you get started, we’ve selected a few @nestjs/azure-database examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github nitro-stack / nitro-cats / server / src / cat / cat.module.ts View on Github external
import { Module } from '@nestjs/common';
import { AzureStorageModule } from '@nestjs/azure-storage';
import { AzureTableStorageModule } from '@nestjs/azure-database';
import { CatController } from './cat.controller';
import { Cat } from './cat.entity';
import { CatService } from './cat.service';

@Module({
  imports: [
    AzureTableStorageModule.forFeature(Cat, {
      table: 'cats',
      createTableIfNotExists: true,
    }),
    AzureStorageModule.withConfig({
      sasKey: process.env.AZURE_STORAGE_SAS_KEY,
      accountName: process.env.AZURE_STORAGE_ACCOUNT,
      containerName: 'nitro-cats-container',
    }),
  ],
  providers: [CatService],
  controllers: [CatController],
})
export class CatModule {}
github nitro-stack / nitro-cats / server / src / cat / cat.entity.ts View on Github external
import {
  EntityPartitionKey,
  EntityRowKey,
  EntityString,
  EntityInt32,
  EntityDateTime,
} from '@nestjs/azure-database';

@EntityPartitionKey('cats')
@EntityRowKey('id')
export class Cat {
  @EntityString() url: string;
  @EntityInt32() rating: number;
  @EntityDateTime() createdAt: Date;

  constructor(cat?: Partial) {
    Object.assign(this, cat);
  }
}
github nitro-stack / nitro-cats / server / src / cat / cat.entity.ts View on Github external
import {
  EntityPartitionKey,
  EntityRowKey,
  EntityString,
  EntityInt32,
  EntityDateTime,
} from '@nestjs/azure-database';

@EntityPartitionKey('cats')
@EntityRowKey('id')
export class Cat {
  @EntityString() url: string;
  @EntityInt32() rating: number;
  @EntityDateTime() createdAt: Date;

  constructor(cat?: Partial) {
    Object.assign(this, cat);
  }
}
github nitro-stack / nitro-cats / server / src / cat / cat.service.ts View on Github external
constructor(
    @InjectRepository(Cat)
    private readonly catRepository: Repository,
  ) {}

@nestjs/azure-database

The Azure Table Storage module for Nest framework (node.js)

MIT
Latest version published 5 months ago

Package Health Score

78 / 100
Full package analysis

Similar packages