return gdaex_sql_builder;
}
-GdaExSqlBuilderField
+static GdaExSqlBuilderField
*gdaex_sql_builder_get_field (GdaExSqlBuilder *sqlb, GdaExSqlBuilderTable *table, const gchar *field_name, const gchar *field_alias, gboolean add)
{
GdaExSqlBuilderPrivate *priv = GDAEX_SQLBUILDER_GET_PRIVATE (sqlb);
return f;
}
-GdaExSqlBuilderTable
+static GdaExSqlBuilderTable
*gdaex_sql_builder_get_table (GdaExSqlBuilder *sqlb, const gchar *table_name, const gchar *table_alias, gboolean add)
{
GdaExSqlBuilderPrivate *priv = GDAEX_SQLBUILDER_GET_PRIVATE (sqlb);
t = gdaex_sql_builder_get_table (sqlb, table_name, table_alias, TRUE);
}
+void
+gdaex_sql_builder_from_v (GdaExSqlBuilder *sqlb, ...)
+{
+ va_list ap;
+
+ GdaExSqlBuilderPrivate *priv = GDAEX_SQLBUILDER_GET_PRIVATE (sqlb);
+
+ va_start (ap, sqlb);
+ do
+ {
+ gchar *table_name = va_arg (ap, gchar *);
+ if (table_name != NULL)
+ {
+ gchar *table_alias = va_arg (ap, gchar *);
+ if (table_alias != NULL)
+ {
+ gdaex_sql_builder_from (sqlb, table_name, table_alias);
+ }
+ else
+ {
+ break;
+ }
+ }
+ else
+ {
+ break;
+ }
+ } while (TRUE);
+}
+
void
gdaex_sql_builder_join (GdaExSqlBuilder *sqlb,
const gchar *table_name,
GdaExSqlBuilder *gdaex_sql_builder_new (GdaSqlStatementType stmt_type);
void gdaex_sql_builder_from (GdaExSqlBuilder *sqlb, const gchar *table_name, const gchar *table_alias);
+void gdaex_sql_builder_from_v (GdaExSqlBuilder *sqlb, ...);
+
void gdaex_sql_builder_join (GdaExSqlBuilder *sqlb,
const gchar *table_name,
GdaSqlSelectJoinType join_type,
const gchar *table_name_right,
...);
+
void gdaex_sql_builder_fields (GdaExSqlBuilder *sqlb, ...);
GdaSqlBuilder *gdaex_sql_builder_get_gda_sql_builder (GdaExSqlBuilder *sqlb);
gtk_init (&argc, &argv);
sqlb = gdaex_sql_builder_new (GDA_SQL_STATEMENT_SELECT);
- gdaex_sql_builder_from (sqlb, "pippo", "pluto");
+
+ gdaex_sql_builder_from_v (sqlb,
+ "pippo", "pluto",
+ "topolino", "",
+ NULL);
+
gdaex_sql_builder_fields (sqlb,
"pippo", "id", "",
"pippo", "name", "the_name",
NULL);
- gdaex_sql_builder_from (sqlb, "topolino", NULL);
gdaex_sql_builder_join (sqlb, "pippo", GDA_SQL_SELECT_JOIN_INNER, "topolino",
"pippo", "id", "",
GDA_SQL_OPERATOR_TYPE_EQ,