summaryrefslogtreecommitdiff
path: root/src/libtracker-sparql/tracker-batch.h
blob: 3a47cede9610160a1a93fadbfb037c7b259b5719 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
/*
 * Copyright (C) 2020 Red Hat Ltd
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library 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
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the
 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 * Boston, MA  02110-1301, USA.
 *
 * Author: Carlos Garnacho
 */
#ifndef __TRACKER_BATCH_H__
#define __TRACKER_BATCH_H__

#if !defined (__LIBTRACKER_SPARQL_INSIDE__) && !defined (TRACKER_COMPILATION)
#error "only <libtracker-sparql/tracker-sparql.h> must be included directly."
#endif

#include <libtracker-sparql/tracker-version.h>
#include <libtracker-sparql/tracker-resource.h>
#include <gio/gio.h>

G_BEGIN_DECLS

#define TRACKER_TYPE_BATCH tracker_batch_get_type ()

TRACKER_AVAILABLE_IN_ALL
G_DECLARE_DERIVABLE_TYPE (TrackerBatch,
                          tracker_batch,
                          TRACKER, BATCH,
                          GObject)

#include "tracker-connection.h"
#include "tracker-statement.h"

TRACKER_AVAILABLE_IN_3_1
TrackerSparqlConnection * tracker_batch_get_connection (TrackerBatch *batch);

TRACKER_AVAILABLE_IN_3_1
void tracker_batch_add_sparql (TrackerBatch *batch,
                               const gchar  *sparql);

TRACKER_AVAILABLE_IN_3_1
void tracker_batch_add_resource (TrackerBatch    *batch,
                                 const gchar     *graph,
                                 TrackerResource *resource);

TRACKER_AVAILABLE_IN_3_5
void tracker_batch_add_statement (TrackerBatch           *batch,
                                  TrackerSparqlStatement *stmt,
                                  ...) G_GNUC_NULL_TERMINATED;

TRACKER_AVAILABLE_IN_3_5
void tracker_batch_add_statementv (TrackerBatch           *batch,
                                   TrackerSparqlStatement *stmt,
                                   guint                   n_values,
                                   const gchar            *variable_names[],
                                   const GValue            values[]);

TRACKER_AVAILABLE_IN_3_1
gboolean tracker_batch_execute (TrackerBatch  *batch,
                                GCancellable  *cancellable,
                                GError       **error);

TRACKER_AVAILABLE_IN_3_1
void tracker_batch_execute_async (TrackerBatch        *batch,
                                  GCancellable        *cancellable,
                                  GAsyncReadyCallback  callback,
                                  gpointer             user_data);

TRACKER_AVAILABLE_IN_3_1
gboolean tracker_batch_execute_finish (TrackerBatch  *batch,
                                       GAsyncResult  *res,
                                       GError       **error);

G_END_DECLS

#endif /* __TRACKER_BATCH_H__ */