MiniOB 1
MiniOB is one mini database, helping developers to learn how database works.
载入中...
搜索中...
未找到
insert_stmt.h
1/* Copyright (c) 2021 OceanBase and/or its affiliates. All rights reserved.
2miniob is licensed under Mulan PSL v2.
3You can use this software according to the terms and conditions of the Mulan PSL v2.
4You may obtain a copy of Mulan PSL v2 at:
5 http://license.coscl.org.cn/MulanPSL2
6THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
7EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
8MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
9See the Mulan PSL v2 for more details. */
10
11//
12// Created by Wangyunlai on 2022/5/22.
13//
14
15#pragma once
16
17#include "common/sys/rc.h"
18#include "sql/stmt/stmt.h"
19
20class Table;
21class Db;
22
27class InsertStmt : public Stmt
28{
29public:
30 InsertStmt() = default;
31 InsertStmt(Table *table, const Value *values, int value_amount);
32
33 StmtType type() const override { return StmtType::INSERT; }
34
35public:
36 static RC create(Db *db, const InsertSqlNode &insert_sql, Stmt *&stmt);
37
38public:
39 Table *table() const { return table_; }
40 const Value *values() const { return values_; }
41 int value_amount() const { return value_amount_; }
42
43private:
44 Table *table_ = nullptr;
45 const Value *values_ = nullptr;
46 int value_amount_ = 0;
47};
一个DB实例负责管理一批表
Definition: db.h:46
插入语句
Definition: insert_stmt.h:28
Stmt for Statement
Definition: stmt.h:83
Definition: table.h:42
属性的值
Definition: value.h:30
描述一个insert语句
Definition: parse_defs.h:112