/*
* Copyright (C) 2012 - Juan Ferrer Toribio
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
#ifndef SQL_INSERT_H
#define SQL_INSERT_H
#define SQL_TYPE_INSERT (sql_insert_get_type ())
#define SQL_INSERT(object) (G_TYPE_CHECK_INSTANCE_CAST (object, SQL_TYPE_INSERT, SqlInsert))
#define SQL_IS_INSERT(object) (G_TYPE_CHECK_INSTANCE_TYPE (object, SQL_TYPE_INSERT))
#include "sql-stmt.h"
#include "sql-field.h"
#include "sql-value.h"
#include "sql-table.h"
typedef struct _SqlInsert SqlInsert;
typedef struct _SqlInsertClass SqlInsertClass;
/**
* SqlInsert:
* @table: an #SqlTable
* @field: (element-type Sql.Field): list of #SqlField
* @expr: (element-type Sql.Expr): list of #SqlExpr
**/
struct _SqlInsert
{
SqlStmt parent;
SqlTable * table;
GSList * field; // List of SqlField
GSList * expr; // List of GSList of SqlExpr
GSList * iter;
};
struct _SqlInsertClass
{
/* */
SqlStmtClass parent;
};
GType sql_insert_get_type ();
SqlInsert * sql_insert_new ();
void sql_insert_set_table (SqlInsert * obj, SqlTable * table);
void sql_insert_add_row (SqlInsert * obj);
void sql_insert_add_field (SqlInsert * obj, SqlField * field);
void sql_insert_add_expr (SqlInsert * obj, SqlExpr * expr);
void sql_insert_clean (SqlInsert * obj);
#endif