1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 | import { DeleteCallback, Metadata, ServiceObject } from '@google-cloud/common';
|
18 | import { ResourceStream } from '@google-cloud/paginator';
|
19 | import { Duplex } from 'stream';
|
20 | import { BigQuery, PagedCallback, PagedRequest, PagedResponse, Query, QueryRowsResponse, ResourceCallback, SimpleQueryRowsCallback } from './bigquery';
|
21 | import { JobCallback, JobResponse, Table, TableMetadata, TableOptions } from './table';
|
22 | import { Model } from './model';
|
23 | import { Routine } from './routine';
|
24 | import bigquery from './types';
|
25 | export interface DatasetDeleteOptions {
|
26 | force?: boolean;
|
27 | }
|
28 | export interface DatasetOptions {
|
29 | location?: string;
|
30 | }
|
31 | export declare type CreateDatasetOptions = bigquery.IDataset;
|
32 | export declare type GetModelsOptions = PagedRequest<bigquery.models.IListParams>;
|
33 | export declare type GetModelsResponse = PagedResponse<Model, GetModelsOptions, bigquery.IListModelsResponse>;
|
34 | export declare type GetModelsCallback = PagedCallback<Model, GetModelsOptions, bigquery.IListModelsResponse>;
|
35 | export declare type GetRoutinesOptions = PagedRequest<bigquery.routines.IListParams>;
|
36 | export declare type GetRoutinesResponse = PagedResponse<Routine, GetRoutinesOptions, bigquery.IListRoutinesResponse>;
|
37 | export declare type GetRoutinesCallback = PagedCallback<Routine, GetRoutinesOptions, bigquery.IListRoutinesResponse>;
|
38 | export declare type GetTablesOptions = PagedRequest<bigquery.tables.IListParams>;
|
39 | export declare type GetTablesResponse = PagedResponse<Table, GetTablesOptions, bigquery.ITableList>;
|
40 | export declare type GetTablesCallback = PagedCallback<Table, GetTablesOptions, bigquery.ITableList>;
|
41 | export declare type RoutineMetadata = bigquery.IRoutine;
|
42 | export declare type RoutineResponse = [Routine, bigquery.IRoutine];
|
43 | export declare type RoutineCallback = ResourceCallback<Routine, bigquery.IRoutine>;
|
44 | export declare type TableResponse = [Table, bigquery.ITable];
|
45 | export declare type TableCallback = ResourceCallback<Table, bigquery.ITable>;
|
46 |
|
47 |
|
48 |
|
49 |
|
50 |
|
51 |
|
52 |
|
53 |
|
54 |
|
55 |
|
56 |
|
57 |
|
58 |
|
59 |
|
60 |
|
61 |
|
62 | declare class Dataset extends ServiceObject {
|
63 | bigQuery: BigQuery;
|
64 | location?: string;
|
65 | getModelsStream: (options?: GetModelsOptions) => ResourceStream<Model>;
|
66 | getRoutinesStream: (options?: GetRoutinesOptions) => ResourceStream<Routine>;
|
67 | getTablesStream: (options?: GetTablesOptions) => ResourceStream<Table>;
|
68 | constructor(bigQuery: BigQuery, id: string, options?: DatasetOptions);
|
69 | createQueryJob(options: string | Query): Promise<JobResponse>;
|
70 | createQueryJob(options: string | Query, callback: JobCallback): void;
|
71 | /**
|
72 | * Run a query scoped to your dataset as a readable object stream.
|
73 | *
|
74 | * See {@link BigQuery#createQueryStream} for full documentation of this
|
75 | * method.
|
76 | *
|
77 | * @param {object} options See {@link BigQuery#createQueryStream} for full
|
78 | * documentation of this method.
|
79 | * @returns {stream}
|
80 | */
|
81 | createQueryStream(options: Query | string): Duplex;
|
82 | createRoutine(id: string, config: RoutineMetadata): Promise<RoutineResponse>;
|
83 | createRoutine(id: string, config: RoutineMetadata, callback: RoutineCallback): void;
|
84 | createTable(id: string, options: TableMetadata): Promise<TableResponse>;
|
85 | createTable(id: string, options: TableMetadata, callback: TableCallback): void;
|
86 | createTable(id: string, callback: TableCallback): void;
|
87 | delete(options?: DatasetDeleteOptions): Promise<[Metadata]>;
|
88 | delete(options: DatasetDeleteOptions, callback: DeleteCallback): void;
|
89 | delete(callback: DeleteCallback): void;
|
90 | getModels(options?: GetModelsOptions): Promise<GetModelsResponse>;
|
91 | getModels(options: GetModelsOptions, callback: GetModelsCallback): void;
|
92 | getModels(callback: GetModelsCallback): void;
|
93 | getRoutines(options?: GetRoutinesOptions): Promise<GetRoutinesResponse>;
|
94 | getRoutines(options: GetRoutinesOptions, callback: GetRoutinesCallback): void;
|
95 | getRoutines(callback: GetRoutinesCallback): void;
|
96 | getTables(options?: GetTablesOptions): Promise<GetTablesResponse>;
|
97 | getTables(options: GetTablesOptions, callback: GetTablesCallback): void;
|
98 | getTables(callback: GetTablesCallback): void;
|
99 | |
100 |
|
101 |
|
102 |
|
103 |
|
104 |
|
105 |
|
106 |
|
107 |
|
108 |
|
109 |
|
110 |
|
111 |
|
112 |
|
113 |
|
114 | model(id: string): Model;
|
115 | query(options: Query): Promise<QueryRowsResponse>;
|
116 | query(options: string): Promise<QueryRowsResponse>;
|
117 | query(options: Query, callback: SimpleQueryRowsCallback): void;
|
118 | query(options: string, callback: SimpleQueryRowsCallback): void;
|
119 | |
120 |
|
121 |
|
122 |
|
123 |
|
124 |
|
125 |
|
126 |
|
127 |
|
128 |
|
129 |
|
130 |
|
131 |
|
132 |
|
133 |
|
134 | routine(id: string): Routine;
|
135 | |
136 |
|
137 |
|
138 |
|
139 |
|
140 |
|
141 |
|
142 |
|
143 |
|
144 |
|
145 |
|
146 |
|
147 |
|
148 |
|
149 |
|
150 |
|
151 |
|
152 |
|
153 |
|
154 |
|
155 |
|
156 |
|
157 | table(id: string, options?: TableOptions): Table;
|
158 | }
|
159 |
|
160 |
|
161 |
|
162 |
|
163 |
|
164 | export { Dataset };
|