2013-10-11 23:07:35 +00:00
|
|
|
/*
|
|
|
|
* 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 <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef SQL_INSERT_H
|
|
|
|
#define SQL_INSERT_H
|
|
|
|
|
2013-10-14 12:08:06 +00:00
|
|
|
#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))
|
2013-10-11 23:07:35 +00:00
|
|
|
|
|
|
|
#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;
|
2013-10-14 12:08:06 +00:00
|
|
|
GSList * field; // List of SqlField
|
|
|
|
GSList * expr; // List of GSList of SqlExpr
|
|
|
|
GSList * iter;
|
2013-10-11 23:07:35 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct _SqlInsertClass
|
|
|
|
{
|
|
|
|
/* <private> */
|
|
|
|
SqlStmtClass parent;
|
|
|
|
};
|
|
|
|
|
2013-10-14 12:08:06 +00:00
|
|
|
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);
|
2013-10-11 23:07:35 +00:00
|
|
|
|
|
|
|
#endif
|