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

sql api updates #8756

Merged
merged 4 commits into from
Feb 8, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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
14 changes: 7 additions & 7 deletions docs/mindsdb_sql/sql/create/jobs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,24 @@ Here is the syntax:

```sql
CREATE JOB [IF NOT EXISTS] [project_name.]job_name [AS] (
<mindsdb_sql_query_1>[; <mindsdb_sql_query_2>]
<statement_1>[; <statement_2>][; ...]
)
[START <date>]
[END <date>]
[EVERY [number] <period>];
[EVERY [number] <period>]
[IF (<statement_1>[; <statement_2>][; ...])];
```

Where:

| Expression | Description |
| --------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `[project_name.]job_name` | Name of the job preceded by an optional project name where the job is to be created. |
| `<mindsdb_sql_query_1>[; <mindsdb_sql_query_2>]` | One or more queries separated by `;` to be executed by the job. |
| `[project_name.]job_name` | Name of the job preceded by an optional project name where the job is to be created. If you do not provide the `project_name` value, then the job is created in the default `mindsdb` project. |
| `<statement_1>[; <statement_2>][; ...]` | One or more statements separated by `;` to be executed by the job. |
| `[START <date>]` | Optional. The date when the job starts its periodical or one-time execution. If not set, it is the current system date. |
| `[END <date>]` | Optional. The date when the job ends its periodical or one-time execution. If it is not set (and the repetition rules are set), then the job repeats forever. |
| `[EVERY [number] <period>]` | Optional. The repetition rules for the job. If not set, the job runs once, not considering the end date value. If the `number` value is not set, it defaults to 1. |
| `[EVERY [number] <period>]` | Optional. The repetition rules for the job. If not set, the job runs once, not considering the end date value. If the `number` value is not set, it defaults to 1. |
| `[IF (<statement_1>[; <statement_2>][; ...])]` | Optional. If the last statement returns one or more rows, only then the job will execute. |

<Info>
**Available `<date>` formats**
Expand All @@ -59,8 +61,6 @@ And the supported `<period>` values:
- `month` / `months`
</Info>

If you do not provide the `project_name` value, then the job is created in the default `mindsdb` project.

Further, you can query all jobs and their execution history like this:

```sql
Expand Down
5 changes: 3 additions & 2 deletions docs/mindsdb_sql/sql/create/model.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ The `CREATE MODEL` statement creates and trains a machine learning (ML) model.
Here is the full syntax:

```sql
CREATE MODEL [IF NOT EXISTS] project_name.predictor_name
CREATE [OR REPLACE] MODEL project_name.predictor_name
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If not exists is also works, so it is possible to use:

CREATE or replace MODEL if not exists predictor_name


[FROM integration_name
(SELECT [sequential_column,] [partition_column,] column_name, ...
Expand All @@ -33,7 +33,8 @@ PREDICT target_column
[HORIZON int]

[USING engine = 'engine_name',
tag = 'tag_name'];
tag = 'tag_name',
...];
```

Where:
Expand Down
Loading