Feature/3 add az table module (#6)

* adding azure table client module

* adding azure table client module

* adding azure table client module
This commit was merged in pull request #6.
This commit is contained in:
2024-08-11 19:03:01 -05:00
committed by GitHub
parent b3e1b31750
commit 09f398c63f
3 changed files with 3 additions and 4 deletions

View File

@@ -1,5 +1,4 @@
export interface TableOptions { export interface TableOptions {
accountName: string; accountName: string;
accountKey: string; accountKey: string;
tableName: string;
} }

View File

@@ -10,9 +10,9 @@ export class TableService {
private tablesOptions: TableOptions private tablesOptions: TableOptions
) {} ) {}
async getTableClient(): Promise<TableClient> { async getTableClient(tableName: string): Promise<TableClient> {
const credential: AzureNamedKeyCredential = new AzureNamedKeyCredential(this.tablesOptions.accountName, this.tablesOptions.accountKey); const credential: AzureNamedKeyCredential = new AzureNamedKeyCredential(this.tablesOptions.accountName, this.tablesOptions.accountKey);
const tableClient: TableClient = new TableClient(`https://${this.tablesOptions.accountName}`, this.tablesOptions.tableName, credential); const tableClient: TableClient = new TableClient(`https://${this.tablesOptions.accountName}.table.core.windows.net`, tableName, credential);
return tableClient; return tableClient;
} }

View File

@@ -1,6 +1,6 @@
{ {
"name": "@noahspan/noahspan-modules", "name": "@noahspan/noahspan-modules",
"version": "0.3.7", "version": "0.3.8",
"description": "", "description": "",
"author": "", "author": "",
"license": "UNLICENSED", "license": "UNLICENSED",