Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Create view #78

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/views/view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default class View {

/** Project the view belongs to. */
project: string;

/**
*
* @param {ViewsApiClient} viewsApiClient - API client to use for executing view operations.
Expand All @@ -31,4 +31,12 @@ export default class View {
async delete(): Promise<void> {
await this.viewsApiClient.deleteView(this.name, this.project);
}

/** Creates a view for the given project
* @param {string} select - SELECT statement to use for initializing the view.
* @throws {MindsDbError} - Something went wrong creating this view.
*/
async create(select:string):Promise<void>{
await this.viewsApiClient.createView(this.name,this.project,select);
}
}