67 lines
1.8 KiB
C
67 lines
1.8 KiB
C
|
/*
|
||
|
* 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_JOIN_H
|
||
|
#define SQL_JOIN_H
|
||
|
|
||
|
#include "sql-target.h"
|
||
|
#include "sql-expr.h"
|
||
|
|
||
|
#define SQL_TYPE_JOIN (sql_join_get_type ())
|
||
|
#define SQL_IS_JOIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE (obj, SQL_TYPE_JOIN))
|
||
|
#define SQL_JOIN(obj) (G_TYPE_CHECK_INSTANCE_CAST (obj, SQL_TYPE_JOIN, SqlJoin))
|
||
|
|
||
|
#define SQL_TYPE_JOIN_TYPE (sql_join_type_get_type ())
|
||
|
|
||
|
typedef struct _SqlJoin SqlJoin;
|
||
|
typedef struct _SqlJoinClass SqlJoinClass;
|
||
|
|
||
|
typedef enum
|
||
|
{
|
||
|
SQL_JOIN_TYPE_INNER
|
||
|
,SQL_JOIN_TYPE_LEFT
|
||
|
,SQL_JOIN_TYPE_RIGHT
|
||
|
,SQL_JOIN_TYPE_COUNT
|
||
|
}
|
||
|
SqlJoinType;
|
||
|
|
||
|
struct _SqlJoin
|
||
|
{
|
||
|
SqlTarget parent;
|
||
|
SqlTarget * target_left;
|
||
|
SqlTarget * target_right;
|
||
|
SqlJoinType type;
|
||
|
SqlExpr * condition;
|
||
|
gboolean has_using;
|
||
|
SqlList * using_fields;
|
||
|
};
|
||
|
|
||
|
struct _SqlJoinClass
|
||
|
{
|
||
|
/* <private> */
|
||
|
SqlTargetClass parent;
|
||
|
};
|
||
|
|
||
|
GType sql_join_get_type ();
|
||
|
GType sql_join_type_get_type ();
|
||
|
|
||
|
SqlTarget * sql_join_new (SqlTarget * left, SqlTarget * right, SqlJoinType type);
|
||
|
void sql_join_set_condition (SqlJoin * obj, SqlExpr * condition);
|
||
|
void sql_join_set_target_right (SqlJoin * obj, SqlTarget * target);
|
||
|
void sql_join_set_target_left (SqlJoin * obj, SqlTarget * target);
|
||
|
|
||
|
#endif
|