~ubuntu-branches/debian/jessie/sqlheavy/jessie

« back to all changes in this revision

Viewing changes to sqlheavy/sqlheavy-row.c

  • Committer: Package Import Robot
  • Author(s): Devid Antonio Filoni
  • Date: 2012-05-17 09:47:17 UTC
  • mfrom: (1.1.1)
  • Revision ID: package-import@ubuntu.com-20120517094717-ue17pqaud5tywjj5
Tags: 0.1.1-1
* New upstream release (Closes: #663320).
* Fix debug-package-should-be-priority-extra lintian warning.
* debian/control: switch to vala-0.16 in Build-Depends field.
* debian/libsqlheavy-dev.install, debian/libsqlheavygtk-dev.install:
  install files in vala-0.16 dir.
* Update libsqlheavy0.1-0.symbols.amd64 file.
* debian/rules: update override_dh_makeshlibs target.
* Bump Standards-Version to 3.9.3.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* sqlheavy-row.c generated by valac 0.12.1, the Vala compiler
 
1
/* sqlheavy-row.c generated by valac 0.16.0, the Vala compiler
2
2
 * generated from sqlheavy-row.vala, do not modify */
3
3
 
4
4
 
64
64
gboolean sql_heavy_value_equal (GValue* a, GValue* b);
65
65
gint sql_heavy_row_direct_compare (SQLHeavyRow* a, SQLHeavyRow* b);
66
66
static GObject * sql_heavy_row_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties);
67
 
static void _lambda2_ (SQLHeavyRow* self);
 
67
static void _sql_heavy_row___lambda4_ (SQLHeavyRow* self);
68
68
void sql_heavy_database_add_step_unlock_notify_row (SQLHeavyDatabase* self, SQLHeavyRow* row);
69
 
static void __lambda2__sql_heavy_row_changed (SQLHeavyRow* _sender, gpointer self);
70
 
static void _lambda3_ (GParamSpec* pspec, SQLHeavyRow* self);
71
 
static void __lambda3__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
 
69
static void __sql_heavy_row___lambda4__sql_heavy_row_changed (SQLHeavyRow* _sender, gpointer self);
 
70
static void _sql_heavy_row___lambda5_ (SQLHeavyRow* self, GParamSpec* pspec);
 
71
static void __sql_heavy_row___lambda5__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
72
72
static void sql_heavy_row_finalize (GObject* obj);
73
73
static void _vala_sql_heavy_row_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
74
74
static void _vala_sql_heavy_row_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
98
98
        GError * _inner_error_ = NULL;
99
99
        self = (SQLHeavyRow*) base;
100
100
        {
101
 
                gint field;
102
 
                gint _tmp0_;
103
 
                gint field_count;
104
 
                GString* _tmp1_ = NULL;
105
 
                GString* sql;
106
 
                gboolean first_field;
107
 
                SQLHeavyQueryable* _tmp19_ = NULL;
108
 
                SQLHeavyQuery* _tmp20_ = NULL;
109
 
                SQLHeavyQuery* query;
 
101
                GValue** _tmp0_;
 
102
                gint _tmp0__length1;
 
103
                _tmp0_ = self->priv->values;
 
104
                _tmp0__length1 = self->priv->values_length1;
110
105
                g_static_rec_mutex_lock (&self->priv->__lock_values);
111
 
                if (self->priv->values == NULL) {
112
 
                        g_static_rec_mutex_unlock (&self->priv->__lock_values);
113
 
                        return;
114
 
                }
115
 
                field = 0;
116
 
                _tmp0_ = sql_heavy_table_get_field_count (self->priv->_table);
117
 
                field_count = _tmp0_;
118
 
                _tmp1_ = g_string_new ("");
119
 
                sql = _tmp1_;
120
 
                first_field = TRUE;
121
 
                if (self->priv->_id > 0) {
122
 
                        const gchar* _tmp2_ = NULL;
123
 
                        _tmp2_ = sql_heavy_table_get_name (self->priv->_table);
124
 
                        g_string_printf (sql, "UPDATE `%s` SET ", _tmp2_);
125
 
                        {
126
 
                                gboolean _tmp3_;
127
 
                                field = 0;
128
 
                                _tmp3_ = TRUE;
129
 
                                while (TRUE) {
130
 
                                        if (!_tmp3_) {
131
 
                                                field++;
132
 
                                        }
133
 
                                        _tmp3_ = FALSE;
134
 
                                        if (!(field < field_count)) {
135
 
                                                break;
136
 
                                        }
137
 
                                        if (self->priv->values[field] != NULL) {
138
 
                                                gchar* _tmp4_ = NULL;
139
 
                                                gchar* field_name;
140
 
                                                const gchar* _tmp5_ = NULL;
141
 
                                                const gchar* _tmp6_ = NULL;
142
 
                                                gchar* _tmp7_ = NULL;
143
 
                                                gchar* _tmp8_;
144
 
                                                if (!first_field) {
145
 
                                                        g_string_append (sql, ", ");
146
 
                                                }
147
 
                                                _tmp4_ = sql_heavy_table_field_name (self->priv->_table, field, &_inner_error_);
148
 
                                                field_name = _tmp4_;
149
 
                                                if (_inner_error_ != NULL) {
150
 
                                                        _g_string_free0 (sql);
151
 
                                                        goto __finally28;
152
 
                                                }
153
 
                                                _tmp5_ = string_to_string (field_name);
154
 
                                                _tmp6_ = string_to_string (field_name);
155
 
                                                _tmp7_ = g_strconcat ("`", _tmp5_, "` = :", _tmp6_, NULL);
156
 
                                                _tmp8_ = _tmp7_;
157
 
                                                g_string_append (sql, _tmp8_);
158
 
                                                _g_free0 (_tmp8_);
159
 
                                                first_field = FALSE;
160
 
                                                _g_free0 (field_name);
161
 
                                        }
162
 
                                }
163
 
                        }
164
 
                        g_string_append (sql, " WHERE `ROWID` = :ROWID;");
165
 
                } else {
166
 
                        const gchar* _tmp9_ = NULL;
167
 
                        GString* _tmp10_ = NULL;
168
 
                        GString* qvalues;
169
 
                        _tmp9_ = sql_heavy_table_get_name (self->priv->_table);
170
 
                        g_string_printf (sql, "INSERT INTO `%s` (", _tmp9_);
171
 
                        _tmp10_ = g_string_new ("");
172
 
                        qvalues = _tmp10_;
173
 
                        {
174
 
                                gboolean _tmp11_;
175
 
                                field = 0;
176
 
                                _tmp11_ = TRUE;
177
 
                                while (TRUE) {
178
 
                                        if (!_tmp11_) {
179
 
                                                field++;
180
 
                                        }
181
 
                                        _tmp11_ = FALSE;
182
 
                                        if (!(field < field_count)) {
183
 
                                                break;
184
 
                                        }
185
 
                                        if (self->priv->values[field] != NULL) {
186
 
                                                gchar* _tmp12_ = NULL;
187
 
                                                gchar* field_name;
188
 
                                                const gchar* _tmp13_ = NULL;
189
 
                                                gchar* _tmp14_ = NULL;
190
 
                                                gchar* _tmp15_;
191
 
                                                const gchar* _tmp16_ = NULL;
192
 
                                                gchar* _tmp17_ = NULL;
193
 
                                                gchar* _tmp18_;
194
 
                                                if (!first_field) {
195
 
                                                        g_string_append (sql, ", ");
196
 
                                                        g_string_append (qvalues, ", ");
197
 
                                                }
198
 
                                                _tmp12_ = sql_heavy_table_field_name (self->priv->_table, field, &_inner_error_);
199
 
                                                field_name = _tmp12_;
200
 
                                                if (_inner_error_ != NULL) {
201
 
                                                        _g_string_free0 (qvalues);
202
 
                                                        _g_string_free0 (sql);
203
 
                                                        goto __finally28;
204
 
                                                }
205
 
                                                _tmp13_ = string_to_string (field_name);
206
 
                                                _tmp14_ = g_strconcat ("`", _tmp13_, "`", NULL);
207
 
                                                _tmp15_ = _tmp14_;
208
 
                                                g_string_append (sql, _tmp15_);
209
 
                                                _g_free0 (_tmp15_);
210
 
                                                _tmp16_ = string_to_string (field_name);
211
 
                                                _tmp17_ = g_strconcat (":", _tmp16_, NULL);
212
 
                                                _tmp18_ = _tmp17_;
213
 
                                                g_string_append (qvalues, _tmp18_);
214
 
                                                _g_free0 (_tmp18_);
215
 
                                                first_field = FALSE;
216
 
                                                _g_free0 (field_name);
217
 
                                        }
218
 
                                }
219
 
                        }
220
 
                        g_string_append (sql, ") VALUES (");
221
 
                        g_string_append (sql, qvalues->str);
222
 
                        g_string_append (sql, ");");
223
 
                        _g_string_free0 (qvalues);
224
 
                }
225
 
                _tmp19_ = sql_heavy_table_get_queryable (self->priv->_table);
226
 
                _tmp20_ = sql_heavy_query_new (_tmp19_, sql->str, &_inner_error_);
227
 
                query = _tmp20_;
228
 
                if (_inner_error_ != NULL) {
 
106
                {
 
107
                        GValue** _tmp1_;
 
108
                        gint _tmp1__length1;
 
109
                        gint field;
 
110
                        SQLHeavyTable* _tmp3_;
 
111
                        gint _tmp4_;
 
112
                        gint _tmp5_;
 
113
                        gint field_count;
 
114
                        GString* _tmp6_;
 
115
                        GString* sql;
 
116
                        gboolean first_field;
 
117
                        gint64 _tmp7_;
 
118
                        SQLHeavyTable* _tmp67_;
 
119
                        SQLHeavyQueryable* _tmp68_;
 
120
                        SQLHeavyQueryable* _tmp69_;
 
121
                        GString* _tmp70_;
 
122
                        const gchar* _tmp71_;
 
123
                        SQLHeavyQuery* _tmp72_;
 
124
                        SQLHeavyQuery* query;
 
125
                        gint64 _tmp92_;
 
126
                        _tmp1_ = self->priv->values;
 
127
                        _tmp1__length1 = self->priv->values_length1;
 
128
                        if (_tmp1_ == NULL) {
 
129
                                {
 
130
                                        GValue** _tmp2_;
 
131
                                        gint _tmp2__length1;
 
132
                                        _tmp2_ = self->priv->values;
 
133
                                        _tmp2__length1 = self->priv->values_length1;
 
134
                                        g_static_rec_mutex_unlock (&self->priv->__lock_values);
 
135
                                }
 
136
                                return;
 
137
                        }
 
138
                        field = 0;
 
139
                        _tmp3_ = self->priv->_table;
 
140
                        _tmp4_ = sql_heavy_table_get_field_count (_tmp3_);
 
141
                        _tmp5_ = _tmp4_;
 
142
                        field_count = _tmp5_;
 
143
                        _tmp6_ = g_string_new ("");
 
144
                        sql = _tmp6_;
 
145
                        first_field = TRUE;
 
146
                        _tmp7_ = self->priv->_id;
 
147
                        if (_tmp7_ > ((gint64) 0)) {
 
148
                                GString* _tmp8_;
 
149
                                SQLHeavyTable* _tmp9_;
 
150
                                const gchar* _tmp10_;
 
151
                                const gchar* _tmp11_;
 
152
                                GString* _tmp32_;
 
153
                                _tmp8_ = sql;
 
154
                                _tmp9_ = self->priv->_table;
 
155
                                _tmp10_ = sql_heavy_table_get_name (_tmp9_);
 
156
                                _tmp11_ = _tmp10_;
 
157
                                g_string_printf (_tmp8_, "UPDATE `%s` SET ", _tmp11_);
 
158
                                {
 
159
                                        gboolean _tmp12_;
 
160
                                        field = 0;
 
161
                                        _tmp12_ = TRUE;
 
162
                                        while (TRUE) {
 
163
                                                gboolean _tmp13_;
 
164
                                                gint _tmp15_;
 
165
                                                gint _tmp16_;
 
166
                                                GValue** _tmp17_;
 
167
                                                gint _tmp17__length1;
 
168
                                                gint _tmp18_;
 
169
                                                GValue* _tmp19_;
 
170
                                                _tmp13_ = _tmp12_;
 
171
                                                if (!_tmp13_) {
 
172
                                                        gint _tmp14_;
 
173
                                                        _tmp14_ = field;
 
174
                                                        field = _tmp14_ + 1;
 
175
                                                }
 
176
                                                _tmp12_ = FALSE;
 
177
                                                _tmp15_ = field;
 
178
                                                _tmp16_ = field_count;
 
179
                                                if (!(_tmp15_ < _tmp16_)) {
 
180
                                                        break;
 
181
                                                }
 
182
                                                _tmp17_ = self->priv->values;
 
183
                                                _tmp17__length1 = self->priv->values_length1;
 
184
                                                _tmp18_ = field;
 
185
                                                _tmp19_ = _tmp17_[_tmp18_];
 
186
                                                if (_tmp19_ != NULL) {
 
187
                                                        gboolean _tmp20_;
 
188
                                                        SQLHeavyTable* _tmp22_;
 
189
                                                        gint _tmp23_;
 
190
                                                        gchar* _tmp24_ = NULL;
 
191
                                                        gchar* field_name;
 
192
                                                        GString* _tmp25_;
 
193
                                                        const gchar* _tmp26_;
 
194
                                                        const gchar* _tmp27_ = NULL;
 
195
                                                        const gchar* _tmp28_;
 
196
                                                        const gchar* _tmp29_ = NULL;
 
197
                                                        gchar* _tmp30_ = NULL;
 
198
                                                        gchar* _tmp31_;
 
199
                                                        _tmp20_ = first_field;
 
200
                                                        if (!_tmp20_) {
 
201
                                                                GString* _tmp21_;
 
202
                                                                _tmp21_ = sql;
 
203
                                                                g_string_append (_tmp21_, ", ");
 
204
                                                        }
 
205
                                                        _tmp22_ = self->priv->_table;
 
206
                                                        _tmp23_ = field;
 
207
                                                        _tmp24_ = sql_heavy_table_field_name (_tmp22_, _tmp23_, &_inner_error_);
 
208
                                                        field_name = _tmp24_;
 
209
                                                        if (_inner_error_ != NULL) {
 
210
                                                                _g_string_free0 (sql);
 
211
                                                                goto __finally28;
 
212
                                                        }
 
213
                                                        _tmp25_ = sql;
 
214
                                                        _tmp26_ = field_name;
 
215
                                                        _tmp27_ = string_to_string (_tmp26_);
 
216
                                                        _tmp28_ = field_name;
 
217
                                                        _tmp29_ = string_to_string (_tmp28_);
 
218
                                                        _tmp30_ = g_strconcat ("`", _tmp27_, "` = :", _tmp29_, NULL);
 
219
                                                        _tmp31_ = _tmp30_;
 
220
                                                        g_string_append (_tmp25_, _tmp31_);
 
221
                                                        _g_free0 (_tmp31_);
 
222
                                                        first_field = FALSE;
 
223
                                                        _g_free0 (field_name);
 
224
                                                }
 
225
                                        }
 
226
                                }
 
227
                                _tmp32_ = sql;
 
228
                                g_string_append (_tmp32_, " WHERE `ROWID` = :ROWID;");
 
229
                        } else {
 
230
                                GString* _tmp33_;
 
231
                                SQLHeavyTable* _tmp34_;
 
232
                                const gchar* _tmp35_;
 
233
                                const gchar* _tmp36_;
 
234
                                GString* _tmp37_;
 
235
                                GString* qvalues;
 
236
                                GString* _tmp62_;
 
237
                                GString* _tmp63_;
 
238
                                GString* _tmp64_;
 
239
                                const gchar* _tmp65_;
 
240
                                GString* _tmp66_;
 
241
                                _tmp33_ = sql;
 
242
                                _tmp34_ = self->priv->_table;
 
243
                                _tmp35_ = sql_heavy_table_get_name (_tmp34_);
 
244
                                _tmp36_ = _tmp35_;
 
245
                                g_string_printf (_tmp33_, "INSERT INTO `%s` (", _tmp36_);
 
246
                                _tmp37_ = g_string_new ("");
 
247
                                qvalues = _tmp37_;
 
248
                                {
 
249
                                        gboolean _tmp38_;
 
250
                                        field = 0;
 
251
                                        _tmp38_ = TRUE;
 
252
                                        while (TRUE) {
 
253
                                                gboolean _tmp39_;
 
254
                                                gint _tmp41_;
 
255
                                                gint _tmp42_;
 
256
                                                GValue** _tmp43_;
 
257
                                                gint _tmp43__length1;
 
258
                                                gint _tmp44_;
 
259
                                                GValue* _tmp45_;
 
260
                                                _tmp39_ = _tmp38_;
 
261
                                                if (!_tmp39_) {
 
262
                                                        gint _tmp40_;
 
263
                                                        _tmp40_ = field;
 
264
                                                        field = _tmp40_ + 1;
 
265
                                                }
 
266
                                                _tmp38_ = FALSE;
 
267
                                                _tmp41_ = field;
 
268
                                                _tmp42_ = field_count;
 
269
                                                if (!(_tmp41_ < _tmp42_)) {
 
270
                                                        break;
 
271
                                                }
 
272
                                                _tmp43_ = self->priv->values;
 
273
                                                _tmp43__length1 = self->priv->values_length1;
 
274
                                                _tmp44_ = field;
 
275
                                                _tmp45_ = _tmp43_[_tmp44_];
 
276
                                                if (_tmp45_ != NULL) {
 
277
                                                        gboolean _tmp46_;
 
278
                                                        SQLHeavyTable* _tmp49_;
 
279
                                                        gint _tmp50_;
 
280
                                                        gchar* _tmp51_ = NULL;
 
281
                                                        gchar* field_name;
 
282
                                                        GString* _tmp52_;
 
283
                                                        const gchar* _tmp53_;
 
284
                                                        const gchar* _tmp54_ = NULL;
 
285
                                                        gchar* _tmp55_ = NULL;
 
286
                                                        gchar* _tmp56_;
 
287
                                                        GString* _tmp57_;
 
288
                                                        const gchar* _tmp58_;
 
289
                                                        const gchar* _tmp59_ = NULL;
 
290
                                                        gchar* _tmp60_ = NULL;
 
291
                                                        gchar* _tmp61_;
 
292
                                                        _tmp46_ = first_field;
 
293
                                                        if (!_tmp46_) {
 
294
                                                                GString* _tmp47_;
 
295
                                                                GString* _tmp48_;
 
296
                                                                _tmp47_ = sql;
 
297
                                                                g_string_append (_tmp47_, ", ");
 
298
                                                                _tmp48_ = qvalues;
 
299
                                                                g_string_append (_tmp48_, ", ");
 
300
                                                        }
 
301
                                                        _tmp49_ = self->priv->_table;
 
302
                                                        _tmp50_ = field;
 
303
                                                        _tmp51_ = sql_heavy_table_field_name (_tmp49_, _tmp50_, &_inner_error_);
 
304
                                                        field_name = _tmp51_;
 
305
                                                        if (_inner_error_ != NULL) {
 
306
                                                                _g_string_free0 (qvalues);
 
307
                                                                _g_string_free0 (sql);
 
308
                                                                goto __finally28;
 
309
                                                        }
 
310
                                                        _tmp52_ = sql;
 
311
                                                        _tmp53_ = field_name;
 
312
                                                        _tmp54_ = string_to_string (_tmp53_);
 
313
                                                        _tmp55_ = g_strconcat ("`", _tmp54_, "`", NULL);
 
314
                                                        _tmp56_ = _tmp55_;
 
315
                                                        g_string_append (_tmp52_, _tmp56_);
 
316
                                                        _g_free0 (_tmp56_);
 
317
                                                        _tmp57_ = qvalues;
 
318
                                                        _tmp58_ = field_name;
 
319
                                                        _tmp59_ = string_to_string (_tmp58_);
 
320
                                                        _tmp60_ = g_strconcat (":", _tmp59_, NULL);
 
321
                                                        _tmp61_ = _tmp60_;
 
322
                                                        g_string_append (_tmp57_, _tmp61_);
 
323
                                                        _g_free0 (_tmp61_);
 
324
                                                        first_field = FALSE;
 
325
                                                        _g_free0 (field_name);
 
326
                                                }
 
327
                                        }
 
328
                                }
 
329
                                _tmp62_ = sql;
 
330
                                g_string_append (_tmp62_, ") VALUES (");
 
331
                                _tmp63_ = sql;
 
332
                                _tmp64_ = qvalues;
 
333
                                _tmp65_ = _tmp64_->str;
 
334
                                g_string_append (_tmp63_, _tmp65_);
 
335
                                _tmp66_ = sql;
 
336
                                g_string_append (_tmp66_, ");");
 
337
                                _g_string_free0 (qvalues);
 
338
                        }
 
339
                        _tmp67_ = self->priv->_table;
 
340
                        _tmp68_ = sql_heavy_table_get_queryable (_tmp67_);
 
341
                        _tmp69_ = _tmp68_;
 
342
                        _tmp70_ = sql;
 
343
                        _tmp71_ = _tmp70_->str;
 
344
                        _tmp72_ = sql_heavy_query_new (_tmp69_, _tmp71_, &_inner_error_);
 
345
                        query = _tmp72_;
 
346
                        if (_inner_error_ != NULL) {
 
347
                                _g_string_free0 (sql);
 
348
                                goto __finally28;
 
349
                        }
 
350
                        {
 
351
                                gboolean _tmp73_;
 
352
                                field = 0;
 
353
                                _tmp73_ = TRUE;
 
354
                                while (TRUE) {
 
355
                                        gboolean _tmp74_;
 
356
                                        gint _tmp76_;
 
357
                                        gint _tmp77_;
 
358
                                        GValue** _tmp78_;
 
359
                                        gint _tmp78__length1;
 
360
                                        gint _tmp79_;
 
361
                                        GValue* _tmp80_;
 
362
                                        _tmp74_ = _tmp73_;
 
363
                                        if (!_tmp74_) {
 
364
                                                gint _tmp75_;
 
365
                                                _tmp75_ = field;
 
366
                                                field = _tmp75_ + 1;
 
367
                                        }
 
368
                                        _tmp73_ = FALSE;
 
369
                                        _tmp76_ = field;
 
370
                                        _tmp77_ = field_count;
 
371
                                        if (!(_tmp76_ < _tmp77_)) {
 
372
                                                break;
 
373
                                        }
 
374
                                        _tmp78_ = self->priv->values;
 
375
                                        _tmp78__length1 = self->priv->values_length1;
 
376
                                        _tmp79_ = field;
 
377
                                        _tmp80_ = _tmp78_[_tmp79_];
 
378
                                        if (_tmp80_ != NULL) {
 
379
                                                SQLHeavyTable* _tmp81_;
 
380
                                                gint _tmp82_;
 
381
                                                gchar* _tmp83_ = NULL;
 
382
                                                gchar* field_name;
 
383
                                                SQLHeavyQuery* _tmp84_;
 
384
                                                const gchar* _tmp85_;
 
385
                                                const gchar* _tmp86_ = NULL;
 
386
                                                gchar* _tmp87_ = NULL;
 
387
                                                gchar* _tmp88_;
 
388
                                                GValue** _tmp89_;
 
389
                                                gint _tmp89__length1;
 
390
                                                gint _tmp90_;
 
391
                                                GValue* _tmp91_;
 
392
                                                _tmp81_ = self->priv->_table;
 
393
                                                _tmp82_ = field;
 
394
                                                _tmp83_ = sql_heavy_table_field_name (_tmp81_, _tmp82_, &_inner_error_);
 
395
                                                field_name = _tmp83_;
 
396
                                                if (_inner_error_ != NULL) {
 
397
                                                        _g_object_unref0 (query);
 
398
                                                        _g_string_free0 (sql);
 
399
                                                        goto __finally28;
 
400
                                                }
 
401
                                                _tmp84_ = query;
 
402
                                                _tmp85_ = field_name;
 
403
                                                _tmp86_ = string_to_string (_tmp85_);
 
404
                                                _tmp87_ = g_strconcat (":", _tmp86_, NULL);
 
405
                                                _tmp88_ = _tmp87_;
 
406
                                                _tmp89_ = self->priv->values;
 
407
                                                _tmp89__length1 = self->priv->values_length1;
 
408
                                                _tmp90_ = field;
 
409
                                                _tmp91_ = _tmp89_[_tmp90_];
 
410
                                                sql_heavy_query_set (_tmp84_, _tmp88_, _tmp91_, &_inner_error_);
 
411
                                                _g_free0 (_tmp88_);
 
412
                                                if (_inner_error_ != NULL) {
 
413
                                                        _g_free0 (field_name);
 
414
                                                        _g_object_unref0 (query);
 
415
                                                        _g_string_free0 (sql);
 
416
                                                        goto __finally28;
 
417
                                                }
 
418
                                                _g_free0 (field_name);
 
419
                                        }
 
420
                                }
 
421
                        }
 
422
                        _tmp92_ = self->priv->_id;
 
423
                        if (_tmp92_ > ((gint64) 0)) {
 
424
                                SQLHeavyQuery* _tmp93_;
 
425
                                gint64 _tmp94_;
 
426
                                SQLHeavyQuery* _tmp95_;
 
427
                                SQLHeavyQueryResult* _tmp96_ = NULL;
 
428
                                SQLHeavyQueryResult* _tmp97_;
 
429
                                _tmp93_ = query;
 
430
                                _tmp94_ = self->priv->_id;
 
431
                                sql_heavy_query_set_int64 (_tmp93_, ":ROWID", _tmp94_, &_inner_error_);
 
432
                                if (_inner_error_ != NULL) {
 
433
                                        _g_object_unref0 (query);
 
434
                                        _g_string_free0 (sql);
 
435
                                        goto __finally28;
 
436
                                }
 
437
                                _tmp95_ = query;
 
438
                                _tmp96_ = sql_heavy_query_execute (_tmp95_, NULL, &_inner_error_, NULL);
 
439
                                _tmp97_ = _tmp96_;
 
440
                                _g_object_unref0 (_tmp97_);
 
441
                                if (_inner_error_ != NULL) {
 
442
                                        _g_object_unref0 (query);
 
443
                                        _g_string_free0 (sql);
 
444
                                        goto __finally28;
 
445
                                }
 
446
                        } else {
 
447
                                SQLHeavyQuery* _tmp98_;
 
448
                                gint64 _tmp99_ = 0LL;
 
449
                                gint64 _tmp100_;
 
450
                                SQLHeavyTable* _tmp101_;
 
451
                                _tmp98_ = query;
 
452
                                _tmp99_ = sql_heavy_query_execute_insert (_tmp98_, NULL, &_inner_error_, NULL);
 
453
                                _tmp100_ = _tmp99_;
 
454
                                if (_inner_error_ != NULL) {
 
455
                                        _g_object_unref0 (query);
 
456
                                        _g_string_free0 (sql);
 
457
                                        goto __finally28;
 
458
                                }
 
459
                                self->priv->_id = _tmp100_;
 
460
                                _tmp101_ = self->priv->_table;
 
461
                                sql_heavy_table_register_row (_tmp101_, self);
 
462
                                sql_heavy_row_update_cache (self, &_inner_error_);
 
463
                                if (_inner_error_ != NULL) {
 
464
                                        _g_object_unref0 (query);
 
465
                                        _g_string_free0 (sql);
 
466
                                        goto __finally28;
 
467
                                }
 
468
                        }
 
469
                        self->priv->values = (_vala_array_free (self->priv->values, self->priv->values_length1, (GDestroyNotify) _vala_GValue_free), NULL);
 
470
                        self->priv->values = NULL;
 
471
                        self->priv->values_length1 = 0;
 
472
                        self->priv->_values_size_ = self->priv->values_length1;
 
473
                        _g_object_unref0 (query);
229
474
                        _g_string_free0 (sql);
230
 
                        goto __finally28;
231
 
                }
232
 
                {
233
 
                        gboolean _tmp21_;
234
 
                        field = 0;
235
 
                        _tmp21_ = TRUE;
236
 
                        while (TRUE) {
237
 
                                if (!_tmp21_) {
238
 
                                        field++;
239
 
                                }
240
 
                                _tmp21_ = FALSE;
241
 
                                if (!(field < field_count)) {
242
 
                                        break;
243
 
                                }
244
 
                                if (self->priv->values[field] != NULL) {
245
 
                                        gchar* _tmp22_ = NULL;
246
 
                                        gchar* field_name;
247
 
                                        const gchar* _tmp23_ = NULL;
248
 
                                        gchar* _tmp24_ = NULL;
249
 
                                        gchar* _tmp25_;
250
 
                                        _tmp22_ = sql_heavy_table_field_name (self->priv->_table, field, &_inner_error_);
251
 
                                        field_name = _tmp22_;
252
 
                                        if (_inner_error_ != NULL) {
253
 
                                                _g_object_unref0 (query);
254
 
                                                _g_string_free0 (sql);
255
 
                                                goto __finally28;
256
 
                                        }
257
 
                                        _tmp23_ = string_to_string (field_name);
258
 
                                        _tmp24_ = g_strconcat (":", _tmp23_, NULL);
259
 
                                        _tmp25_ = _tmp24_;
260
 
                                        sql_heavy_query_set (query, _tmp25_, self->priv->values[field], &_inner_error_);
261
 
                                        _g_free0 (_tmp25_);
262
 
                                        if (_inner_error_ != NULL) {
263
 
                                                _g_free0 (field_name);
264
 
                                                _g_object_unref0 (query);
265
 
                                                _g_string_free0 (sql);
266
 
                                                goto __finally28;
267
 
                                        }
268
 
                                        _g_free0 (field_name);
269
 
                                }
270
 
                        }
271
 
                }
272
 
                if (self->priv->_id > 0) {
273
 
                        SQLHeavyQueryResult* _tmp26_ = NULL;
274
 
                        SQLHeavyQueryResult* _tmp27_;
275
 
                        sql_heavy_query_set_int64 (query, ":ROWID", self->priv->_id, &_inner_error_);
276
 
                        if (_inner_error_ != NULL) {
277
 
                                _g_object_unref0 (query);
278
 
                                _g_string_free0 (sql);
279
 
                                goto __finally28;
280
 
                        }
281
 
                        _tmp26_ = sql_heavy_query_execute (query, NULL, &_inner_error_, NULL);
282
 
                        _tmp27_ = _tmp26_;
283
 
                        _g_object_unref0 (_tmp27_);
284
 
                        if (_inner_error_ != NULL) {
285
 
                                _g_object_unref0 (query);
286
 
                                _g_string_free0 (sql);
287
 
                                goto __finally28;
288
 
                        }
289
 
                } else {
290
 
                        gint64 _tmp28_;
291
 
                        gint64 _tmp29_;
292
 
                        _tmp28_ = sql_heavy_query_execute_insert (query, NULL, &_inner_error_, NULL);
293
 
                        _tmp29_ = _tmp28_;
294
 
                        if (_inner_error_ != NULL) {
295
 
                                _g_object_unref0 (query);
296
 
                                _g_string_free0 (sql);
297
 
                                goto __finally28;
298
 
                        }
299
 
                        self->priv->_id = _tmp29_;
300
 
                        sql_heavy_table_register_row (self->priv->_table, self);
301
 
                        sql_heavy_row_update_cache (self, &_inner_error_);
302
 
                        if (_inner_error_ != NULL) {
303
 
                                _g_object_unref0 (query);
304
 
                                _g_string_free0 (sql);
305
 
                                goto __finally28;
306
 
                        }
307
 
                }
308
 
                self->priv->values = (_vala_array_free (self->priv->values, self->priv->values_length1, (GDestroyNotify) _vala_GValue_free), NULL);
309
 
                self->priv->values = NULL;
310
 
                self->priv->values_length1 = 0;
311
 
                self->priv->_values_size_ = 0;
312
 
                _g_object_unref0 (query);
313
 
                _g_string_free0 (sql);
 
475
                }
314
476
                __finally28:
315
 
                g_static_rec_mutex_unlock (&self->priv->__lock_values);
 
477
                {
 
478
                        GValue** _tmp102_;
 
479
                        gint _tmp102__length1;
 
480
                        _tmp102_ = self->priv->values;
 
481
                        _tmp102__length1 = self->priv->values_length1;
 
482
                        g_static_rec_mutex_unlock (&self->priv->__lock_values);
 
483
                }
316
484
                if (_inner_error_ != NULL) {
317
485
                        if (_inner_error_->domain == SQL_HEAVY_ERROR) {
318
486
                                g_propagate_error (error, _inner_error_);
333
501
static gint sql_heavy_row_real_field_index (SQLHeavyRecord* base, const gchar* field, GError** error) {
334
502
        SQLHeavyRow * self;
335
503
        gint result = 0;
336
 
        gint _tmp0_;
337
 
        gint _tmp1_;
 
504
        SQLHeavyTable* _tmp0_;
 
505
        const gchar* _tmp1_;
 
506
        gint _tmp2_ = 0;
 
507
        gint _tmp3_;
338
508
        GError * _inner_error_ = NULL;
339
509
        self = (SQLHeavyRow*) base;
340
510
        g_return_val_if_fail (field != NULL, 0);
341
 
        _tmp0_ = sql_heavy_table_field_index (self->priv->_table, field, &_inner_error_);
342
 
        _tmp1_ = _tmp0_;
 
511
        _tmp0_ = self->priv->_table;
 
512
        _tmp1_ = field;
 
513
        _tmp2_ = sql_heavy_table_field_index (_tmp0_, _tmp1_, &_inner_error_);
 
514
        _tmp3_ = _tmp2_;
343
515
        if (_inner_error_ != NULL) {
344
516
                if (_inner_error_->domain == SQL_HEAVY_ERROR) {
345
517
                        g_propagate_error (error, _inner_error_);
350
522
                        return 0;
351
523
                }
352
524
        }
353
 
        result = _tmp1_;
 
525
        result = _tmp3_;
354
526
        return result;
355
527
}
356
528
 
361
533
static gchar* sql_heavy_row_real_field_name (SQLHeavyRecord* base, gint field, GError** error) {
362
534
        SQLHeavyRow * self;
363
535
        gchar* result = NULL;
364
 
        gchar* _tmp0_ = NULL;
365
 
        gchar* _tmp1_;
 
536
        SQLHeavyTable* _tmp0_;
 
537
        gint _tmp1_;
 
538
        gchar* _tmp2_ = NULL;
 
539
        gchar* _tmp3_;
366
540
        GError * _inner_error_ = NULL;
367
541
        self = (SQLHeavyRow*) base;
368
 
        _tmp0_ = sql_heavy_table_field_name (self->priv->_table, field, &_inner_error_);
369
 
        _tmp1_ = _tmp0_;
 
542
        _tmp0_ = self->priv->_table;
 
543
        _tmp1_ = field;
 
544
        _tmp2_ = sql_heavy_table_field_name (_tmp0_, _tmp1_, &_inner_error_);
 
545
        _tmp3_ = _tmp2_;
370
546
        if (_inner_error_ != NULL) {
371
547
                if (_inner_error_->domain == SQL_HEAVY_ERROR) {
372
548
                        g_propagate_error (error, _inner_error_);
377
553
                        return NULL;
378
554
                }
379
555
        }
380
 
        result = _tmp1_;
 
556
        result = _tmp3_;
381
557
        return result;
382
558
}
383
559
 
388
564
static GType sql_heavy_row_real_field_type (SQLHeavyRecord* base, gint field, GError** error) {
389
565
        SQLHeavyRow * self;
390
566
        GType result = 0UL;
391
 
        GValue _tmp0_ = {0};
 
567
        gint _tmp0_;
392
568
        GValue _tmp1_ = {0};
393
569
        GValue _tmp2_;
394
 
        GValue _tmp3_;
395
 
        GType _tmp4_;
396
 
        GType _tmp5_;
 
570
        GType _tmp3_ = 0UL;
397
571
        GError * _inner_error_ = NULL;
398
572
        self = (SQLHeavyRow*) base;
399
 
        sql_heavy_record_fetch ((SQLHeavyRecord*) self, field, &_tmp0_, &_inner_error_);
400
 
        _tmp1_ = _tmp0_;
 
573
        _tmp0_ = field;
 
574
        sql_heavy_record_fetch ((SQLHeavyRecord*) self, _tmp0_, &_tmp1_, &_inner_error_);
401
575
        _tmp2_ = _tmp1_;
402
576
        if (_inner_error_ != NULL) {
403
577
                if (_inner_error_->domain == SQL_HEAVY_ERROR) {
409
583
                        return 0UL;
410
584
                }
411
585
        }
412
 
        _tmp3_ = _tmp2_;
413
 
        _tmp4_ = G_VALUE_TYPE (&_tmp3_);
414
 
        _tmp5_ = _tmp4_;
415
 
        G_IS_VALUE (&_tmp3_) ? (g_value_unset (&_tmp3_), NULL) : NULL;
416
 
        result = _tmp5_;
 
586
        _tmp3_ = G_VALUE_TYPE (&_tmp2_);
 
587
        result = _tmp3_;
417
588
        return result;
418
589
}
419
590
 
433
604
 
434
605
static void sql_heavy_row_real_put (SQLHeavyMutableRecord* base, gint field, GValue* value, GError** error) {
435
606
        SQLHeavyRow * self;
436
 
        gint _tmp0_;
 
607
        SQLHeavyTable* _tmp0_;
 
608
        gint _tmp1_;
 
609
        gint _tmp2_;
437
610
        gint field_count;
438
 
        gboolean _tmp1_ = FALSE;
 
611
        gboolean _tmp3_ = FALSE;
 
612
        gint _tmp4_;
 
613
        gboolean _tmp7_;
439
614
        GError * _inner_error_ = NULL;
440
615
        self = (SQLHeavyRow*) base;
441
 
        _tmp0_ = sql_heavy_table_get_field_count (self->priv->_table);
442
 
        field_count = _tmp0_;
443
 
        if (field < 0) {
444
 
                _tmp1_ = TRUE;
 
616
        g_return_if_fail (value != NULL);
 
617
        _tmp0_ = self->priv->_table;
 
618
        _tmp1_ = sql_heavy_table_get_field_count (_tmp0_);
 
619
        _tmp2_ = _tmp1_;
 
620
        field_count = _tmp2_;
 
621
        _tmp4_ = field;
 
622
        if (_tmp4_ < 0) {
 
623
                _tmp3_ = TRUE;
445
624
        } else {
446
 
                _tmp1_ = field >= field_count;
 
625
                gint _tmp5_;
 
626
                gint _tmp6_;
 
627
                _tmp5_ = field;
 
628
                _tmp6_ = field_count;
 
629
                _tmp3_ = _tmp5_ >= _tmp6_;
447
630
        }
448
 
        if (_tmp1_) {
449
 
                GError* _tmp2_ = NULL;
450
 
                _tmp2_ = g_error_new (SQL_HEAVY_ERROR, SQL_HEAVY_ERROR_RANGE, "Invalid field index (%d)", field);
451
 
                _inner_error_ = _tmp2_;
 
631
        _tmp7_ = _tmp3_;
 
632
        if (_tmp7_) {
 
633
                gint _tmp8_;
 
634
                GError* _tmp9_;
 
635
                _tmp8_ = field;
 
636
                _tmp9_ = g_error_new (SQL_HEAVY_ERROR, SQL_HEAVY_ERROR_RANGE, "Invalid field index (%d)", _tmp8_);
 
637
                _inner_error_ = _tmp9_;
452
638
                if (_inner_error_->domain == SQL_HEAVY_ERROR) {
453
639
                        g_propagate_error (error, _inner_error_);
454
640
                        return;
459
645
                }
460
646
        }
461
647
        {
462
 
                GValue* _tmp4_;
463
 
                GValue* _tmp5_;
 
648
                GValue** _tmp10_;
 
649
                gint _tmp10__length1;
 
650
                _tmp10_ = self->priv->values;
 
651
                _tmp10__length1 = self->priv->values_length1;
464
652
                g_static_rec_mutex_lock (&self->priv->__lock_values);
465
 
                if (self->priv->values == NULL) {
466
 
                        GValue* _tmp3_ = NULL;
467
 
                        _tmp3_ = g_new0 (GValue, field_count);
468
 
                        self->priv->values = (_vala_array_free (self->priv->values, self->priv->values_length1, (GDestroyNotify) _vala_GValue_free), NULL);
469
 
                        self->priv->values = _tmp3_;
470
 
                        self->priv->values_length1 = field_count;
471
 
                        self->priv->_values_size_ = field_count;
 
653
                {
 
654
                        GValue** _tmp11_;
 
655
                        gint _tmp11__length1;
 
656
                        GValue** _tmp14_;
 
657
                        gint _tmp14__length1;
 
658
                        gint _tmp15_;
 
659
                        GValue _tmp16_;
 
660
                        GValue _tmp17_;
 
661
                        GValue* _tmp18_;
 
662
                        GValue* _tmp19_;
 
663
                        _tmp11_ = self->priv->values;
 
664
                        _tmp11__length1 = self->priv->values_length1;
 
665
                        if (_tmp11_ == NULL) {
 
666
                                gint _tmp12_;
 
667
                                GValue** _tmp13_ = NULL;
 
668
                                _tmp12_ = field_count;
 
669
                                _tmp13_ = g_new0 (GValue*, _tmp12_);
 
670
                                self->priv->values = (_vala_array_free (self->priv->values, self->priv->values_length1, (GDestroyNotify) _vala_GValue_free), NULL);
 
671
                                self->priv->values = _tmp13_;
 
672
                                self->priv->values_length1 = _tmp12_;
 
673
                                self->priv->_values_size_ = self->priv->values_length1;
 
674
                        }
 
675
                        _tmp14_ = self->priv->values;
 
676
                        _tmp14__length1 = self->priv->values_length1;
 
677
                        _tmp15_ = field;
 
678
                        _tmp16_ = *value;
 
679
                        _tmp17_ = _tmp16_;
 
680
                        _tmp18_ = __g_value_dup0 (&_tmp17_);
 
681
                        __vala_GValue_free0 (_tmp14_[_tmp15_]);
 
682
                        _tmp14_[_tmp15_] = _tmp18_;
 
683
                        _tmp19_ = _tmp14_[_tmp15_];
472
684
                }
473
 
                _tmp4_ = __g_value_dup0 (value);
474
 
                _tmp5_ = _tmp4_;
475
 
                __vala_GValue_free0 (self->priv->values[field]);
476
 
                self->priv->values[field] = _tmp5_;
477
685
                __finally29:
478
 
                g_static_rec_mutex_unlock (&self->priv->__lock_values);
 
686
                {
 
687
                        GValue** _tmp20_;
 
688
                        gint _tmp20__length1;
 
689
                        _tmp20_ = self->priv->values;
 
690
                        _tmp20__length1 = self->priv->values_length1;
 
691
                        g_static_rec_mutex_unlock (&self->priv->__lock_values);
 
692
                }
479
693
                if (_inner_error_ != NULL) {
480
694
                        if (_inner_error_->domain == SQL_HEAVY_ERROR) {
481
695
                                g_propagate_error (error, _inner_error_);
504
718
     */
505
719
static void sql_heavy_row_real_delete (SQLHeavyMutableRecord* base, GError** error) {
506
720
        SQLHeavyRow * self;
 
721
        gint64 _tmp0_;
507
722
        GError * _inner_error_ = NULL;
508
723
        self = (SQLHeavyRow*) base;
509
 
        if (self->priv->_id > 0) {
510
 
                SQLHeavyQueryable* _tmp0_ = NULL;
511
 
                const gchar* _tmp1_ = NULL;
512
 
                const gchar* _tmp2_ = NULL;
513
 
                gchar* _tmp3_ = NULL;
514
 
                gchar* _tmp4_;
515
 
                SQLHeavyQuery* _tmp5_ = NULL;
516
 
                SQLHeavyQuery* _tmp6_;
 
724
        _tmp0_ = self->priv->_id;
 
725
        if (_tmp0_ > ((gint64) 0)) {
 
726
                SQLHeavyTable* _tmp1_;
 
727
                SQLHeavyQueryable* _tmp2_;
 
728
                SQLHeavyQueryable* _tmp3_;
 
729
                SQLHeavyTable* _tmp4_;
 
730
                const gchar* _tmp5_;
 
731
                const gchar* _tmp6_;
 
732
                const gchar* _tmp7_ = NULL;
 
733
                gchar* _tmp8_ = NULL;
 
734
                gchar* _tmp9_;
 
735
                SQLHeavyQuery* _tmp10_ = NULL;
 
736
                SQLHeavyQuery* _tmp11_;
517
737
                SQLHeavyQuery* query;
518
 
                SQLHeavyQueryResult* _tmp7_ = NULL;
519
 
                SQLHeavyQueryResult* _tmp8_;
520
 
                _tmp0_ = sql_heavy_table_get_queryable (self->priv->_table);
521
 
                _tmp1_ = sql_heavy_table_get_name (self->priv->_table);
522
 
                _tmp2_ = string_to_string (_tmp1_);
523
 
                _tmp3_ = g_strconcat ("DELETE FROM `", _tmp2_, "` WHERE `ROWID` = :id;", NULL);
524
 
                _tmp4_ = _tmp3_;
525
 
                _tmp5_ = sql_heavy_queryable_prepare (_tmp0_, _tmp4_, &_inner_error_);
 
738
                SQLHeavyQuery* _tmp12_;
 
739
                gint64 _tmp13_;
 
740
                SQLHeavyQuery* _tmp14_;
 
741
                SQLHeavyQueryResult* _tmp15_ = NULL;
 
742
                SQLHeavyQueryResult* _tmp16_;
 
743
                _tmp1_ = self->priv->_table;
 
744
                _tmp2_ = sql_heavy_table_get_queryable (_tmp1_);
 
745
                _tmp3_ = _tmp2_;
 
746
                _tmp4_ = self->priv->_table;
 
747
                _tmp5_ = sql_heavy_table_get_name (_tmp4_);
526
748
                _tmp6_ = _tmp5_;
527
 
                _g_free0 (_tmp4_);
528
 
                query = _tmp6_;
529
 
                if (_inner_error_ != NULL) {
530
 
                        if (_inner_error_->domain == SQL_HEAVY_ERROR) {
531
 
                                g_propagate_error (error, _inner_error_);
532
 
                                return;
533
 
                        } else {
534
 
                                g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
535
 
                                g_clear_error (&_inner_error_);
536
 
                                return;
537
 
                        }
538
 
                }
539
 
                sql_heavy_query_set_int64 (query, ":id", self->priv->_id, &_inner_error_);
540
 
                if (_inner_error_ != NULL) {
541
 
                        if (_inner_error_->domain == SQL_HEAVY_ERROR) {
542
 
                                g_propagate_error (error, _inner_error_);
543
 
                                _g_object_unref0 (query);
544
 
                                return;
545
 
                        } else {
546
 
                                _g_object_unref0 (query);
547
 
                                g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
548
 
                                g_clear_error (&_inner_error_);
549
 
                                return;
550
 
                        }
551
 
                }
552
 
                _tmp7_ = sql_heavy_query_execute (query, NULL, &_inner_error_, NULL);
553
 
                _tmp8_ = _tmp7_;
554
 
                _g_object_unref0 (_tmp8_);
 
749
                _tmp7_ = string_to_string (_tmp6_);
 
750
                _tmp8_ = g_strconcat ("DELETE FROM `", _tmp7_, "` WHERE `ROWID` = :id;", NULL);
 
751
                _tmp9_ = _tmp8_;
 
752
                _tmp10_ = sql_heavy_queryable_prepare (_tmp3_, _tmp9_, &_inner_error_);
 
753
                _tmp11_ = _tmp10_;
 
754
                _g_free0 (_tmp9_);
 
755
                query = _tmp11_;
 
756
                if (_inner_error_ != NULL) {
 
757
                        if (_inner_error_->domain == SQL_HEAVY_ERROR) {
 
758
                                g_propagate_error (error, _inner_error_);
 
759
                                return;
 
760
                        } else {
 
761
                                g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
 
762
                                g_clear_error (&_inner_error_);
 
763
                                return;
 
764
                        }
 
765
                }
 
766
                _tmp12_ = query;
 
767
                _tmp13_ = self->priv->_id;
 
768
                sql_heavy_query_set_int64 (_tmp12_, ":id", _tmp13_, &_inner_error_);
 
769
                if (_inner_error_ != NULL) {
 
770
                        if (_inner_error_->domain == SQL_HEAVY_ERROR) {
 
771
                                g_propagate_error (error, _inner_error_);
 
772
                                _g_object_unref0 (query);
 
773
                                return;
 
774
                        } else {
 
775
                                _g_object_unref0 (query);
 
776
                                g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
 
777
                                g_clear_error (&_inner_error_);
 
778
                                return;
 
779
                        }
 
780
                }
 
781
                _tmp14_ = query;
 
782
                _tmp15_ = sql_heavy_query_execute (_tmp14_, NULL, &_inner_error_, NULL);
 
783
                _tmp16_ = _tmp15_;
 
784
                _g_object_unref0 (_tmp16_);
555
785
                if (_inner_error_ != NULL) {
556
786
                        if (_inner_error_->domain == SQL_HEAVY_ERROR) {
557
787
                                g_propagate_error (error, _inner_error_);
575
805
static void sql_heavy_row_real_fetch (SQLHeavyRecord* base, gint field, GValue* result, GError** error) {
576
806
        SQLHeavyRow * self;
577
807
        gboolean _tmp0_ = FALSE;
578
 
        gboolean _tmp3_ = FALSE;
579
 
        gchar* _tmp6_ = NULL;
 
808
        GValue** _tmp1_;
 
809
        gint _tmp1__length1;
 
810
        gboolean _tmp5_;
 
811
        gboolean _tmp10_ = FALSE;
 
812
        gboolean _tmp11_;
 
813
        gboolean _tmp15_;
 
814
        SQLHeavyTable* _tmp20_;
 
815
        gint _tmp21_;
 
816
        gchar* _tmp22_ = NULL;
580
817
        gchar* field_name;
581
 
        SQLHeavyQueryable* _tmp8_ = NULL;
582
 
        const gchar* _tmp9_ = NULL;
583
 
        const gchar* _tmp10_ = NULL;
584
 
        const gchar* _tmp11_ = NULL;
585
 
        gchar* _tmp12_ = NULL;
586
 
        gchar* _tmp13_;
587
 
        SQLHeavyQuery* _tmp14_ = NULL;
588
 
        SQLHeavyQuery* _tmp15_;
 
818
        gint64 _tmp23_;
 
819
        SQLHeavyTable* _tmp26_;
 
820
        SQLHeavyQueryable* _tmp27_;
 
821
        SQLHeavyQueryable* _tmp28_;
 
822
        const gchar* _tmp29_;
 
823
        const gchar* _tmp30_ = NULL;
 
824
        SQLHeavyTable* _tmp31_;
 
825
        const gchar* _tmp32_;
 
826
        const gchar* _tmp33_;
 
827
        const gchar* _tmp34_ = NULL;
 
828
        gchar* _tmp35_ = NULL;
 
829
        gchar* _tmp36_;
 
830
        SQLHeavyQuery* _tmp37_;
 
831
        SQLHeavyQuery* _tmp38_;
589
832
        SQLHeavyQuery* query;
590
 
        SQLHeavyQueryResult* _tmp16_ = NULL;
591
 
        SQLHeavyQueryResult* _tmp17_;
592
 
        SQLHeavyQueryResult* _tmp18_;
593
 
        GValue _tmp19_ = {0};
594
 
        GValue _tmp20_ = {0};
595
 
        GValue _tmp21_;
596
 
        GValue _tmp22_;
 
833
        SQLHeavyQuery* _tmp39_;
 
834
        gint64 _tmp40_;
 
835
        SQLHeavyQuery* _tmp41_;
 
836
        SQLHeavyQueryResult* _tmp42_ = NULL;
 
837
        SQLHeavyQueryResult* _tmp43_;
 
838
        SQLHeavyQueryResult* _tmp44_;
 
839
        GValue _tmp45_ = {0};
 
840
        GValue _tmp46_;
 
841
        GValue _tmp47_;
597
842
        GError * _inner_error_ = NULL;
598
843
        self = (SQLHeavyRow*) base;
599
 
        if (self->priv->values != NULL) {
600
 
                _tmp0_ = self->priv->values[field] != NULL;
 
844
        _tmp1_ = self->priv->values;
 
845
        _tmp1__length1 = self->priv->values_length1;
 
846
        if (_tmp1_ != NULL) {
 
847
                GValue** _tmp2_;
 
848
                gint _tmp2__length1;
 
849
                gint _tmp3_;
 
850
                GValue* _tmp4_;
 
851
                _tmp2_ = self->priv->values;
 
852
                _tmp2__length1 = self->priv->values_length1;
 
853
                _tmp3_ = field;
 
854
                _tmp4_ = _tmp2_[_tmp3_];
 
855
                _tmp0_ = _tmp4_ != NULL;
601
856
        } else {
602
857
                _tmp0_ = FALSE;
603
858
        }
604
 
        if (_tmp0_) {
605
 
                GValue _tmp1_;
606
 
                GValue _tmp2_ = {0};
607
 
                if (G_IS_VALUE (self->priv->values[field])) {
608
 
                        g_value_init (&_tmp2_, G_VALUE_TYPE (self->priv->values[field]));
609
 
                        g_value_copy (self->priv->values[field], &_tmp2_);
 
859
        _tmp5_ = _tmp0_;
 
860
        if (_tmp5_) {
 
861
                GValue** _tmp6_;
 
862
                gint _tmp6__length1;
 
863
                gint _tmp7_;
 
864
                GValue* _tmp8_;
 
865
                GValue _tmp9_ = {0};
 
866
                _tmp6_ = self->priv->values;
 
867
                _tmp6__length1 = self->priv->values_length1;
 
868
                _tmp7_ = field;
 
869
                _tmp8_ = _tmp6_[_tmp7_];
 
870
                if (G_IS_VALUE (_tmp8_)) {
 
871
                        g_value_init (&_tmp9_, G_VALUE_TYPE (_tmp8_));
 
872
                        g_value_copy (_tmp8_, &_tmp9_);
610
873
                } else {
611
 
                        _tmp2_ = *self->priv->values[field];
 
874
                        _tmp9_ = *_tmp8_;
612
875
                }
613
 
                _tmp1_ = _tmp2_;
614
 
                *result = _tmp1_;
 
876
                *result = _tmp9_;
615
877
                return;
616
878
        }
617
 
        if (self->priv->_enable_cache) {
618
 
                _tmp3_ = self->priv->cache[field] != NULL;
 
879
        _tmp11_ = self->priv->_enable_cache;
 
880
        if (_tmp11_) {
 
881
                GValue** _tmp12_;
 
882
                gint _tmp12__length1;
 
883
                gint _tmp13_;
 
884
                GValue* _tmp14_;
 
885
                _tmp12_ = self->priv->cache;
 
886
                _tmp12__length1 = self->priv->cache_length1;
 
887
                _tmp13_ = field;
 
888
                _tmp14_ = _tmp12_[_tmp13_];
 
889
                _tmp10_ = _tmp14_ != NULL;
619
890
        } else {
620
 
                _tmp3_ = FALSE;
 
891
                _tmp10_ = FALSE;
621
892
        }
622
 
        if (_tmp3_) {
623
 
                GValue _tmp4_;
624
 
                GValue _tmp5_ = {0};
625
 
                if (G_IS_VALUE (self->priv->cache[field])) {
626
 
                        g_value_init (&_tmp5_, G_VALUE_TYPE (self->priv->cache[field]));
627
 
                        g_value_copy (self->priv->cache[field], &_tmp5_);
 
893
        _tmp15_ = _tmp10_;
 
894
        if (_tmp15_) {
 
895
                GValue** _tmp16_;
 
896
                gint _tmp16__length1;
 
897
                gint _tmp17_;
 
898
                GValue* _tmp18_;
 
899
                GValue _tmp19_ = {0};
 
900
                _tmp16_ = self->priv->cache;
 
901
                _tmp16__length1 = self->priv->cache_length1;
 
902
                _tmp17_ = field;
 
903
                _tmp18_ = _tmp16_[_tmp17_];
 
904
                if (G_IS_VALUE (_tmp18_)) {
 
905
                        g_value_init (&_tmp19_, G_VALUE_TYPE (_tmp18_));
 
906
                        g_value_copy (_tmp18_, &_tmp19_);
628
907
                } else {
629
 
                        _tmp5_ = *self->priv->cache[field];
 
908
                        _tmp19_ = *_tmp18_;
630
909
                }
631
 
                _tmp4_ = _tmp5_;
632
 
                *result = _tmp4_;
 
910
                *result = _tmp19_;
633
911
                return;
634
912
        }
635
 
        _tmp6_ = sql_heavy_table_field_name (self->priv->_table, field, &_inner_error_);
636
 
        field_name = _tmp6_;
637
 
        if (_inner_error_ != NULL) {
638
 
                if (_inner_error_->domain == SQL_HEAVY_ERROR) {
639
 
                        g_propagate_error (error, _inner_error_);
640
 
                        return;
641
 
                } else {
642
 
                        g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
643
 
                        g_clear_error (&_inner_error_);
644
 
                        return;
645
 
                }
646
 
        }
647
 
        if (self->priv->_id <= 0) {
648
 
                GError* _tmp7_ = NULL;
649
 
                _tmp7_ = g_error_new (SQL_HEAVY_ERROR, SQL_HEAVY_ERROR_MISUSE, "Cannot read field `%s` from row not persisted to database.", field_name);
650
 
                _inner_error_ = _tmp7_;
651
 
                if (_inner_error_->domain == SQL_HEAVY_ERROR) {
652
 
                        g_propagate_error (error, _inner_error_);
653
 
                        _g_free0 (field_name);
654
 
                        return;
655
 
                } else {
656
 
                        _g_free0 (field_name);
657
 
                        g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
658
 
                        g_clear_error (&_inner_error_);
659
 
                        return;
660
 
                }
661
 
        }
662
 
        _tmp8_ = sql_heavy_table_get_queryable (self->priv->_table);
663
 
        _tmp9_ = string_to_string (field_name);
664
 
        _tmp10_ = sql_heavy_table_get_name (self->priv->_table);
665
 
        _tmp11_ = string_to_string (_tmp10_);
666
 
        _tmp12_ = g_strconcat ("SELECT `", _tmp9_, "` FROM `", _tmp11_, "` WHERE `ROWID` = :id;", NULL);
667
 
        _tmp13_ = _tmp12_;
668
 
        _tmp14_ = sql_heavy_query_new (_tmp8_, _tmp13_, &_inner_error_);
669
 
        _tmp15_ = _tmp14_;
670
 
        _g_free0 (_tmp13_);
671
 
        query = _tmp15_;
672
 
        if (_inner_error_ != NULL) {
673
 
                if (_inner_error_->domain == SQL_HEAVY_ERROR) {
674
 
                        g_propagate_error (error, _inner_error_);
675
 
                        _g_free0 (field_name);
676
 
                        return;
677
 
                } else {
678
 
                        _g_free0 (field_name);
679
 
                        g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
680
 
                        g_clear_error (&_inner_error_);
681
 
                        return;
682
 
                }
683
 
        }
684
 
        sql_heavy_query_set_int64 (query, ":id", self->priv->_id, &_inner_error_);
685
 
        if (_inner_error_ != NULL) {
686
 
                if (_inner_error_->domain == SQL_HEAVY_ERROR) {
687
 
                        g_propagate_error (error, _inner_error_);
688
 
                        _g_object_unref0 (query);
689
 
                        _g_free0 (field_name);
690
 
                        return;
691
 
                } else {
692
 
                        _g_object_unref0 (query);
693
 
                        _g_free0 (field_name);
694
 
                        g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
695
 
                        g_clear_error (&_inner_error_);
696
 
                        return;
697
 
                }
698
 
        }
699
 
        _tmp16_ = sql_heavy_query_execute (query, NULL, &_inner_error_, NULL);
700
 
        _tmp17_ = _tmp16_;
701
 
        if (_inner_error_ != NULL) {
702
 
                if (_inner_error_->domain == SQL_HEAVY_ERROR) {
703
 
                        g_propagate_error (error, _inner_error_);
704
 
                        _g_object_unref0 (query);
705
 
                        _g_free0 (field_name);
706
 
                        return;
707
 
                } else {
708
 
                        _g_object_unref0 (query);
709
 
                        _g_free0 (field_name);
710
 
                        g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
711
 
                        g_clear_error (&_inner_error_);
712
 
                        return;
713
 
                }
714
 
        }
715
 
        _tmp18_ = _tmp17_;
716
 
        sql_heavy_record_fetch ((SQLHeavyRecord*) _tmp18_, 0, &_tmp19_, &_inner_error_);
717
 
        _tmp20_ = _tmp19_;
718
 
        _tmp21_ = _tmp20_;
719
 
        _g_object_unref0 (_tmp18_);
720
 
        _tmp22_ = _tmp21_;
721
 
        if (_inner_error_ != NULL) {
722
 
                if (_inner_error_->domain == SQL_HEAVY_ERROR) {
723
 
                        g_propagate_error (error, _inner_error_);
724
 
                        _g_object_unref0 (query);
725
 
                        _g_free0 (field_name);
726
 
                        return;
727
 
                } else {
728
 
                        _g_object_unref0 (query);
729
 
                        _g_free0 (field_name);
730
 
                        g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
731
 
                        g_clear_error (&_inner_error_);
732
 
                        return;
733
 
                }
734
 
        }
735
 
        *result = _tmp22_;
 
913
        _tmp20_ = self->priv->_table;
 
914
        _tmp21_ = field;
 
915
        _tmp22_ = sql_heavy_table_field_name (_tmp20_, _tmp21_, &_inner_error_);
 
916
        field_name = _tmp22_;
 
917
        if (_inner_error_ != NULL) {
 
918
                if (_inner_error_->domain == SQL_HEAVY_ERROR) {
 
919
                        g_propagate_error (error, _inner_error_);
 
920
                        return;
 
921
                } else {
 
922
                        g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
 
923
                        g_clear_error (&_inner_error_);
 
924
                        return;
 
925
                }
 
926
        }
 
927
        _tmp23_ = self->priv->_id;
 
928
        if (_tmp23_ <= ((gint64) 0)) {
 
929
                const gchar* _tmp24_;
 
930
                GError* _tmp25_;
 
931
                _tmp24_ = field_name;
 
932
                _tmp25_ = g_error_new (SQL_HEAVY_ERROR, SQL_HEAVY_ERROR_MISUSE, "Cannot read field `%s` from row not persisted to database.", _tmp24_);
 
933
                _inner_error_ = _tmp25_;
 
934
                if (_inner_error_->domain == SQL_HEAVY_ERROR) {
 
935
                        g_propagate_error (error, _inner_error_);
 
936
                        _g_free0 (field_name);
 
937
                        return;
 
938
                } else {
 
939
                        _g_free0 (field_name);
 
940
                        g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
 
941
                        g_clear_error (&_inner_error_);
 
942
                        return;
 
943
                }
 
944
        }
 
945
        _tmp26_ = self->priv->_table;
 
946
        _tmp27_ = sql_heavy_table_get_queryable (_tmp26_);
 
947
        _tmp28_ = _tmp27_;
 
948
        _tmp29_ = field_name;
 
949
        _tmp30_ = string_to_string (_tmp29_);
 
950
        _tmp31_ = self->priv->_table;
 
951
        _tmp32_ = sql_heavy_table_get_name (_tmp31_);
 
952
        _tmp33_ = _tmp32_;
 
953
        _tmp34_ = string_to_string (_tmp33_);
 
954
        _tmp35_ = g_strconcat ("SELECT `", _tmp30_, "` FROM `", _tmp34_, "` WHERE `ROWID` = :id;", NULL);
 
955
        _tmp36_ = _tmp35_;
 
956
        _tmp37_ = sql_heavy_query_new (_tmp28_, _tmp36_, &_inner_error_);
 
957
        _tmp38_ = _tmp37_;
 
958
        _g_free0 (_tmp36_);
 
959
        query = _tmp38_;
 
960
        if (_inner_error_ != NULL) {
 
961
                if (_inner_error_->domain == SQL_HEAVY_ERROR) {
 
962
                        g_propagate_error (error, _inner_error_);
 
963
                        _g_free0 (field_name);
 
964
                        return;
 
965
                } else {
 
966
                        _g_free0 (field_name);
 
967
                        g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
 
968
                        g_clear_error (&_inner_error_);
 
969
                        return;
 
970
                }
 
971
        }
 
972
        _tmp39_ = query;
 
973
        _tmp40_ = self->priv->_id;
 
974
        sql_heavy_query_set_int64 (_tmp39_, ":id", _tmp40_, &_inner_error_);
 
975
        if (_inner_error_ != NULL) {
 
976
                if (_inner_error_->domain == SQL_HEAVY_ERROR) {
 
977
                        g_propagate_error (error, _inner_error_);
 
978
                        _g_object_unref0 (query);
 
979
                        _g_free0 (field_name);
 
980
                        return;
 
981
                } else {
 
982
                        _g_object_unref0 (query);
 
983
                        _g_free0 (field_name);
 
984
                        g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
 
985
                        g_clear_error (&_inner_error_);
 
986
                        return;
 
987
                }
 
988
        }
 
989
        _tmp41_ = query;
 
990
        _tmp42_ = sql_heavy_query_execute (_tmp41_, NULL, &_inner_error_, NULL);
 
991
        _tmp43_ = _tmp42_;
 
992
        if (_inner_error_ != NULL) {
 
993
                if (_inner_error_->domain == SQL_HEAVY_ERROR) {
 
994
                        g_propagate_error (error, _inner_error_);
 
995
                        _g_object_unref0 (query);
 
996
                        _g_free0 (field_name);
 
997
                        return;
 
998
                } else {
 
999
                        _g_object_unref0 (query);
 
1000
                        _g_free0 (field_name);
 
1001
                        g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
 
1002
                        g_clear_error (&_inner_error_);
 
1003
                        return;
 
1004
                }
 
1005
        }
 
1006
        _tmp44_ = _tmp43_;
 
1007
        sql_heavy_record_fetch ((SQLHeavyRecord*) _tmp44_, 0, &_tmp45_, &_inner_error_);
 
1008
        _tmp46_ = _tmp45_;
 
1009
        _g_object_unref0 (_tmp44_);
 
1010
        _tmp47_ = _tmp46_;
 
1011
        if (_inner_error_ != NULL) {
 
1012
                if (_inner_error_->domain == SQL_HEAVY_ERROR) {
 
1013
                        g_propagate_error (error, _inner_error_);
 
1014
                        _g_object_unref0 (query);
 
1015
                        _g_free0 (field_name);
 
1016
                        return;
 
1017
                } else {
 
1018
                        _g_object_unref0 (query);
 
1019
                        _g_free0 (field_name);
 
1020
                        g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
 
1021
                        g_clear_error (&_inner_error_);
 
1022
                        return;
 
1023
                }
 
1024
        }
 
1025
        *result = _tmp47_;
736
1026
        _g_object_unref0 (query);
737
1027
        _g_free0 (field_name);
738
1028
        return;
745
1035
static SQLHeavyRow* sql_heavy_row_real_fetch_foreign_row (SQLHeavyRecord* base, gint field, GError** error) {
746
1036
        SQLHeavyRow * self;
747
1037
        SQLHeavyRow* result = NULL;
748
 
        gchar* _tmp0_ = NULL;
749
 
        gchar* _tmp1_;
 
1038
        gint _tmp0_;
 
1039
        gchar* _tmp1_ = NULL;
750
1040
        gchar* _tmp2_;
751
 
        SQLHeavyRow* _tmp3_ = NULL;
752
 
        SQLHeavyRow* _tmp4_;
 
1041
        gchar* _tmp3_;
 
1042
        SQLHeavyRow* _tmp4_ = NULL;
753
1043
        SQLHeavyRow* _tmp5_;
 
1044
        SQLHeavyRow* _tmp6_;
754
1045
        GError * _inner_error_ = NULL;
755
1046
        self = (SQLHeavyRow*) base;
756
 
        _tmp0_ = sql_heavy_record_field_name ((SQLHeavyRecord*) self, field, &_inner_error_);
757
 
        _tmp1_ = _tmp0_;
758
 
        if (_inner_error_ != NULL) {
759
 
                if (_inner_error_->domain == SQL_HEAVY_ERROR) {
760
 
                        g_propagate_error (error, _inner_error_);
761
 
                        return NULL;
762
 
                } else {
763
 
                        g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
764
 
                        g_clear_error (&_inner_error_);
765
 
                        return NULL;
766
 
                }
767
 
        }
 
1047
        _tmp0_ = field;
 
1048
        _tmp1_ = sql_heavy_record_field_name ((SQLHeavyRecord*) self, _tmp0_, &_inner_error_);
768
1049
        _tmp2_ = _tmp1_;
769
 
        _tmp3_ = sql_heavy_record_get_foreign_row ((SQLHeavyRecord*) self, _tmp2_, &_inner_error_);
770
 
        _tmp4_ = _tmp3_;
771
 
        _g_free0 (_tmp2_);
 
1050
        if (_inner_error_ != NULL) {
 
1051
                if (_inner_error_->domain == SQL_HEAVY_ERROR) {
 
1052
                        g_propagate_error (error, _inner_error_);
 
1053
                        return NULL;
 
1054
                } else {
 
1055
                        g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
 
1056
                        g_clear_error (&_inner_error_);
 
1057
                        return NULL;
 
1058
                }
 
1059
        }
 
1060
        _tmp3_ = _tmp2_;
 
1061
        _tmp4_ = sql_heavy_record_get_foreign_row ((SQLHeavyRecord*) self, _tmp3_, &_inner_error_);
772
1062
        _tmp5_ = _tmp4_;
 
1063
        _g_free0 (_tmp3_);
 
1064
        _tmp6_ = _tmp5_;
773
1065
        if (_inner_error_ != NULL) {
774
1066
                if (_inner_error_->domain == SQL_HEAVY_ERROR) {
775
1067
                        g_propagate_error (error, _inner_error_);
780
1072
                        return NULL;
781
1073
                }
782
1074
        }
783
 
        result = _tmp5_;
 
1075
        result = _tmp6_;
784
1076
        return result;
785
1077
}
786
1078
 
791
1083
static SQLHeavyRow* sql_heavy_row_real_get_foreign_row (SQLHeavyRecord* base, const gchar* field, GError** error) {
792
1084
        SQLHeavyRow * self;
793
1085
        SQLHeavyRow* result = NULL;
794
 
        gint _tmp0_;
 
1086
        SQLHeavyTable* _tmp0_;
 
1087
        const gchar* _tmp1_;
 
1088
        gint _tmp2_ = 0;
795
1089
        gint foreign_key_idx;
796
 
        SQLHeavyTable* _tmp1_ = NULL;
 
1090
        SQLHeavyTable* _tmp3_;
 
1091
        gint _tmp4_;
 
1092
        SQLHeavyTable* _tmp5_ = NULL;
797
1093
        SQLHeavyTable* foreign_table;
798
 
        gint64 _tmp2_;
799
 
        gint64 _tmp3_;
800
 
        SQLHeavyRow* _tmp4_ = NULL;
 
1094
        const gchar* _tmp6_;
 
1095
        gint64 _tmp7_ = 0LL;
 
1096
        gint64 _tmp8_;
 
1097
        SQLHeavyTable* _tmp9_;
 
1098
        SQLHeavyRow* _tmp10_;
801
1099
        GError * _inner_error_ = NULL;
802
1100
        self = (SQLHeavyRow*) base;
803
1101
        g_return_val_if_fail (field != NULL, NULL);
804
 
        _tmp0_ = sql_heavy_table_foreign_key_index (self->priv->_table, field, &_inner_error_);
805
 
        foreign_key_idx = _tmp0_;
806
 
        if (_inner_error_ != NULL) {
807
 
                if (_inner_error_->domain == SQL_HEAVY_ERROR) {
808
 
                        g_propagate_error (error, _inner_error_);
809
 
                        return NULL;
810
 
                } else {
811
 
                        g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
812
 
                        g_clear_error (&_inner_error_);
813
 
                        return NULL;
814
 
                }
815
 
        }
816
 
        _tmp1_ = sql_heavy_table_foreign_key_table (self->priv->_table, foreign_key_idx, &_inner_error_);
817
 
        foreign_table = _tmp1_;
818
 
        if (_inner_error_ != NULL) {
819
 
                if (_inner_error_->domain == SQL_HEAVY_ERROR) {
820
 
                        g_propagate_error (error, _inner_error_);
821
 
                        return NULL;
822
 
                } else {
823
 
                        g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
824
 
                        g_clear_error (&_inner_error_);
825
 
                        return NULL;
826
 
                }
827
 
        }
828
 
        _tmp2_ = sql_heavy_record_get_int64 ((SQLHeavyRecord*) self, field, &_inner_error_);
829
 
        _tmp3_ = _tmp2_;
830
 
        if (_inner_error_ != NULL) {
831
 
                if (_inner_error_->domain == SQL_HEAVY_ERROR) {
832
 
                        g_propagate_error (error, _inner_error_);
833
 
                        _g_object_unref0 (foreign_table);
834
 
                        return NULL;
835
 
                } else {
836
 
                        _g_object_unref0 (foreign_table);
837
 
                        g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
838
 
                        g_clear_error (&_inner_error_);
839
 
                        return NULL;
840
 
                }
841
 
        }
842
 
        _tmp4_ = sql_heavy_row_new (foreign_table, _tmp3_);
843
 
        result = _tmp4_;
 
1102
        _tmp0_ = self->priv->_table;
 
1103
        _tmp1_ = field;
 
1104
        _tmp2_ = sql_heavy_table_foreign_key_index (_tmp0_, _tmp1_, &_inner_error_);
 
1105
        foreign_key_idx = _tmp2_;
 
1106
        if (_inner_error_ != NULL) {
 
1107
                if (_inner_error_->domain == SQL_HEAVY_ERROR) {
 
1108
                        g_propagate_error (error, _inner_error_);
 
1109
                        return NULL;
 
1110
                } else {
 
1111
                        g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
 
1112
                        g_clear_error (&_inner_error_);
 
1113
                        return NULL;
 
1114
                }
 
1115
        }
 
1116
        _tmp3_ = self->priv->_table;
 
1117
        _tmp4_ = foreign_key_idx;
 
1118
        _tmp5_ = sql_heavy_table_foreign_key_table (_tmp3_, _tmp4_, &_inner_error_);
 
1119
        foreign_table = _tmp5_;
 
1120
        if (_inner_error_ != NULL) {
 
1121
                if (_inner_error_->domain == SQL_HEAVY_ERROR) {
 
1122
                        g_propagate_error (error, _inner_error_);
 
1123
                        return NULL;
 
1124
                } else {
 
1125
                        g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
 
1126
                        g_clear_error (&_inner_error_);
 
1127
                        return NULL;
 
1128
                }
 
1129
        }
 
1130
        _tmp6_ = field;
 
1131
        _tmp7_ = sql_heavy_record_get_int64 ((SQLHeavyRecord*) self, _tmp6_, &_inner_error_);
 
1132
        _tmp8_ = _tmp7_;
 
1133
        if (_inner_error_ != NULL) {
 
1134
                if (_inner_error_->domain == SQL_HEAVY_ERROR) {
 
1135
                        g_propagate_error (error, _inner_error_);
 
1136
                        _g_object_unref0 (foreign_table);
 
1137
                        return NULL;
 
1138
                } else {
 
1139
                        _g_object_unref0 (foreign_table);
 
1140
                        g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
 
1141
                        g_clear_error (&_inner_error_);
 
1142
                        return NULL;
 
1143
                }
 
1144
        }
 
1145
        _tmp9_ = foreign_table;
 
1146
        _tmp10_ = sql_heavy_row_new (_tmp9_, _tmp8_);
 
1147
        result = _tmp10_;
844
1148
        _g_object_unref0 (foreign_table);
845
1149
        return result;
846
1150
}
853
1157
        GError * _inner_error_ = NULL;
854
1158
        g_return_if_fail (self != NULL);
855
1159
        {
856
 
                gint fc = 0;
857
 
                SQLHeavyQueryable* _tmp2_ = NULL;
858
 
                const gchar* _tmp3_ = NULL;
859
 
                const gchar* _tmp4_ = NULL;
860
 
                gchar* _tmp5_ = NULL;
861
 
                gchar* _tmp6_;
862
 
                SQLHeavyQuery* _tmp7_ = NULL;
863
 
                SQLHeavyQuery* _tmp8_;
864
 
                SQLHeavyQuery* query;
865
 
                SQLHeavyQueryResult* _tmp9_ = NULL;
866
 
                SQLHeavyQueryResult* _tmp10_;
867
 
                SQLHeavyQueryResult* _tmp11_;
868
 
                GValueArray* _tmp12_ = NULL;
869
 
                GValueArray* _tmp13_;
870
 
                GValueArray* res;
871
 
                gboolean* _tmp14_ = NULL;
872
 
                gboolean* fields_changed;
873
 
                gint fields_changed_length1;
874
 
                gint _fields_changed_size_;
875
 
                gint f;
 
1160
                GValue** _tmp0_;
 
1161
                gint _tmp0__length1;
 
1162
                _tmp0_ = self->priv->cache;
 
1163
                _tmp0__length1 = self->priv->cache_length1;
876
1164
                g_static_rec_mutex_lock (&self->priv->__lock_cache);
877
 
                if (self->priv->_id == 0) {
878
 
                        g_static_rec_mutex_unlock (&self->priv->__lock_cache);
879
 
                        return;
880
 
                }
881
 
                if (!self->priv->_enable_cache) {
882
 
                        self->priv->cache = (_vala_array_free (self->priv->cache, self->priv->cache_length1, (GDestroyNotify) _vala_GValue_free), NULL);
883
 
                        self->priv->cache = NULL;
884
 
                        self->priv->cache_length1 = 0;
885
 
                        self->priv->_cache_size_ = 0;
886
 
                        g_static_rec_mutex_unlock (&self->priv->__lock_cache);
887
 
                        return;
888
 
                } else {
889
 
                        gint _tmp0_;
890
 
                        _tmp0_ = sql_heavy_record_get_field_count ((SQLHeavyRecord*) self);
891
 
                        fc = _tmp0_;
892
 
                        if (self->priv->cache == NULL) {
893
 
                                GValue* _tmp1_ = NULL;
894
 
                                _tmp1_ = g_new0 (GValue, fc);
 
1165
                {
 
1166
                        gint64 _tmp1_;
 
1167
                        gint fc = 0;
 
1168
                        gboolean _tmp3_;
 
1169
                        SQLHeavyTable* _tmp10_;
 
1170
                        SQLHeavyQueryable* _tmp11_;
 
1171
                        SQLHeavyQueryable* _tmp12_;
 
1172
                        SQLHeavyTable* _tmp13_;
 
1173
                        const gchar* _tmp14_;
 
1174
                        const gchar* _tmp15_;
 
1175
                        const gchar* _tmp16_ = NULL;
 
1176
                        gchar* _tmp17_ = NULL;
 
1177
                        gchar* _tmp18_;
 
1178
                        SQLHeavyQuery* _tmp19_;
 
1179
                        SQLHeavyQuery* _tmp20_;
 
1180
                        SQLHeavyQuery* query;
 
1181
                        SQLHeavyQuery* _tmp21_;
 
1182
                        gint64 _tmp22_;
 
1183
                        SQLHeavyQuery* _tmp23_;
 
1184
                        SQLHeavyQueryResult* _tmp24_;
 
1185
                        SQLHeavyQueryResult* _tmp25_;
 
1186
                        SQLHeavyQueryResult* _tmp26_;
 
1187
                        GValueArray* _tmp27_ = NULL;
 
1188
                        GValueArray* _tmp28_;
 
1189
                        GValueArray* res;
 
1190
                        gint _tmp29_;
 
1191
                        gboolean* _tmp30_ = NULL;
 
1192
                        gboolean* fields_changed;
 
1193
                        gint fields_changed_length1;
 
1194
                        gint _fields_changed_size_;
 
1195
                        gint f;
 
1196
                        _tmp1_ = self->priv->_id;
 
1197
                        if (_tmp1_ == ((gint64) 0)) {
 
1198
                                {
 
1199
                                        GValue** _tmp2_;
 
1200
                                        gint _tmp2__length1;
 
1201
                                        _tmp2_ = self->priv->cache;
 
1202
                                        _tmp2__length1 = self->priv->cache_length1;
 
1203
                                        g_static_rec_mutex_unlock (&self->priv->__lock_cache);
 
1204
                                }
 
1205
                                return;
 
1206
                        }
 
1207
                        _tmp3_ = self->priv->_enable_cache;
 
1208
                        if (!_tmp3_) {
895
1209
                                self->priv->cache = (_vala_array_free (self->priv->cache, self->priv->cache_length1, (GDestroyNotify) _vala_GValue_free), NULL);
896
 
                                self->priv->cache = _tmp1_;
897
 
                                self->priv->cache_length1 = fc;
898
 
                                self->priv->_cache_size_ = fc;
899
 
                        }
900
 
                }
901
 
                _tmp2_ = sql_heavy_table_get_queryable (self->priv->_table);
902
 
                _tmp3_ = sql_heavy_table_get_name (self->priv->_table);
903
 
                _tmp4_ = string_to_string (_tmp3_);
904
 
                _tmp5_ = g_strconcat ("SELECT * FROM `", _tmp4_, "` WHERE `ROWID` = :id;", NULL);
905
 
                _tmp6_ = _tmp5_;
906
 
                _tmp7_ = sql_heavy_query_new (_tmp2_, _tmp6_, &_inner_error_);
907
 
                _tmp8_ = _tmp7_;
908
 
                _g_free0 (_tmp6_);
909
 
                query = _tmp8_;
910
 
                if (_inner_error_ != NULL) {
911
 
                        goto __finally30;
912
 
                }
913
 
                sql_heavy_query_set_int64 (query, ":id", self->priv->_id, &_inner_error_);
914
 
                if (_inner_error_ != NULL) {
915
 
                        _g_object_unref0 (query);
916
 
                        goto __finally30;
917
 
                }
918
 
                _tmp9_ = sql_heavy_query_result_new_no_lock (query, &_inner_error_);
919
 
                _tmp10_ = _tmp9_;
920
 
                if (_inner_error_ != NULL) {
921
 
                        _g_object_unref0 (query);
922
 
                        goto __finally30;
923
 
                }
924
 
                _tmp11_ = _tmp10_;
925
 
                _tmp12_ = sql_heavy_record_fetch_row ((SQLHeavyRecord*) _tmp11_, &_inner_error_);
926
 
                _tmp13_ = _tmp12_;
927
 
                _g_object_unref0 (_tmp11_);
928
 
                res = _tmp13_;
929
 
                if (_inner_error_ != NULL) {
930
 
                        _g_object_unref0 (query);
931
 
                        goto __finally30;
932
 
                }
933
 
                _tmp14_ = g_new0 (gboolean, fc);
934
 
                fields_changed = _tmp14_;
935
 
                fields_changed_length1 = fc;
936
 
                _fields_changed_size_ = fc;
937
 
                f = 0;
938
 
                {
939
 
                        gboolean _tmp15_;
940
 
                        f = 0;
941
 
                        _tmp15_ = TRUE;
942
 
                        while (TRUE) {
943
 
                                gboolean _tmp16_ = FALSE;
944
 
                                if (!_tmp15_) {
945
 
                                        f++;
946
 
                                }
947
 
                                _tmp15_ = FALSE;
948
 
                                if (!(f < fc)) {
949
 
                                        break;
950
 
                                }
951
 
                                if (self->priv->cache[f] == NULL) {
952
 
                                        _tmp16_ = TRUE;
953
 
                                } else {
954
 
                                        GValue _tmp17_;
955
 
                                        gboolean _tmp18_;
956
 
                                        _tmp17_ = res->values[f];
957
 
                                        _tmp18_ = sql_heavy_value_equal (self->priv->cache[f], &_tmp17_);
958
 
                                        _tmp16_ = !_tmp18_;
959
 
                                }
960
 
                                if (_tmp16_) {
961
 
                                        GValue _tmp19_;
962
 
                                        GValue* _tmp20_;
963
 
                                        GValue* _tmp21_;
964
 
                                        fields_changed[f] = self->priv->cache[f] != NULL;
965
 
                                        _tmp19_ = res->values[f];
966
 
                                        _tmp20_ = __g_value_dup0 (&_tmp19_);
967
 
                                        _tmp21_ = _tmp20_;
968
 
                                        __vala_GValue_free0 (self->priv->cache[f]);
969
 
                                        self->priv->cache[f] = _tmp21_;
970
 
                                } else {
971
 
                                        fields_changed[f] = FALSE;
972
 
                                }
973
 
                        }
974
 
                }
975
 
                {
976
 
                        gboolean _tmp22_;
977
 
                        f = 0;
978
 
                        _tmp22_ = TRUE;
979
 
                        while (TRUE) {
980
 
                                if (!_tmp22_) {
981
 
                                        f++;
982
 
                                }
983
 
                                _tmp22_ = FALSE;
984
 
                                if (!(f < fc)) {
985
 
                                        break;
986
 
                                }
987
 
                                if (fields_changed[f]) {
988
 
                                        g_signal_emit_by_name (self, "field-changed", f);
989
 
                                }
990
 
                        }
991
 
                }
992
 
                fields_changed = (g_free (fields_changed), NULL);
993
 
                _g_value_array_free0 (res);
994
 
                _g_object_unref0 (query);
 
1210
                                self->priv->cache = NULL;
 
1211
                                self->priv->cache_length1 = 0;
 
1212
                                self->priv->_cache_size_ = self->priv->cache_length1;
 
1213
                                {
 
1214
                                        GValue** _tmp4_;
 
1215
                                        gint _tmp4__length1;
 
1216
                                        _tmp4_ = self->priv->cache;
 
1217
                                        _tmp4__length1 = self->priv->cache_length1;
 
1218
                                        g_static_rec_mutex_unlock (&self->priv->__lock_cache);
 
1219
                                }
 
1220
                                return;
 
1221
                        } else {
 
1222
                                gint _tmp5_;
 
1223
                                gint _tmp6_;
 
1224
                                GValue** _tmp7_;
 
1225
                                gint _tmp7__length1;
 
1226
                                _tmp5_ = sql_heavy_record_get_field_count ((SQLHeavyRecord*) self);
 
1227
                                _tmp6_ = _tmp5_;
 
1228
                                fc = _tmp6_;
 
1229
                                _tmp7_ = self->priv->cache;
 
1230
                                _tmp7__length1 = self->priv->cache_length1;
 
1231
                                if (_tmp7_ == NULL) {
 
1232
                                        gint _tmp8_;
 
1233
                                        GValue** _tmp9_ = NULL;
 
1234
                                        _tmp8_ = fc;
 
1235
                                        _tmp9_ = g_new0 (GValue*, _tmp8_);
 
1236
                                        self->priv->cache = (_vala_array_free (self->priv->cache, self->priv->cache_length1, (GDestroyNotify) _vala_GValue_free), NULL);
 
1237
                                        self->priv->cache = _tmp9_;
 
1238
                                        self->priv->cache_length1 = _tmp8_;
 
1239
                                        self->priv->_cache_size_ = self->priv->cache_length1;
 
1240
                                }
 
1241
                        }
 
1242
                        _tmp10_ = self->priv->_table;
 
1243
                        _tmp11_ = sql_heavy_table_get_queryable (_tmp10_);
 
1244
                        _tmp12_ = _tmp11_;
 
1245
                        _tmp13_ = self->priv->_table;
 
1246
                        _tmp14_ = sql_heavy_table_get_name (_tmp13_);
 
1247
                        _tmp15_ = _tmp14_;
 
1248
                        _tmp16_ = string_to_string (_tmp15_);
 
1249
                        _tmp17_ = g_strconcat ("SELECT * FROM `", _tmp16_, "` WHERE `ROWID` = :id;", NULL);
 
1250
                        _tmp18_ = _tmp17_;
 
1251
                        _tmp19_ = sql_heavy_query_new (_tmp12_, _tmp18_, &_inner_error_);
 
1252
                        _tmp20_ = _tmp19_;
 
1253
                        _g_free0 (_tmp18_);
 
1254
                        query = _tmp20_;
 
1255
                        if (_inner_error_ != NULL) {
 
1256
                                goto __finally30;
 
1257
                        }
 
1258
                        _tmp21_ = query;
 
1259
                        _tmp22_ = self->priv->_id;
 
1260
                        sql_heavy_query_set_int64 (_tmp21_, ":id", _tmp22_, &_inner_error_);
 
1261
                        if (_inner_error_ != NULL) {
 
1262
                                _g_object_unref0 (query);
 
1263
                                goto __finally30;
 
1264
                        }
 
1265
                        _tmp23_ = query;
 
1266
                        _tmp24_ = sql_heavy_query_result_new_no_lock (_tmp23_, &_inner_error_);
 
1267
                        _tmp25_ = _tmp24_;
 
1268
                        if (_inner_error_ != NULL) {
 
1269
                                _g_object_unref0 (query);
 
1270
                                goto __finally30;
 
1271
                        }
 
1272
                        _tmp26_ = _tmp25_;
 
1273
                        _tmp27_ = sql_heavy_record_fetch_row ((SQLHeavyRecord*) _tmp26_, &_inner_error_);
 
1274
                        _tmp28_ = _tmp27_;
 
1275
                        _g_object_unref0 (_tmp26_);
 
1276
                        res = _tmp28_;
 
1277
                        if (_inner_error_ != NULL) {
 
1278
                                _g_object_unref0 (query);
 
1279
                                goto __finally30;
 
1280
                        }
 
1281
                        _tmp29_ = fc;
 
1282
                        _tmp30_ = g_new0 (gboolean, _tmp29_);
 
1283
                        fields_changed = _tmp30_;
 
1284
                        fields_changed_length1 = _tmp29_;
 
1285
                        _fields_changed_size_ = fields_changed_length1;
 
1286
                        f = 0;
 
1287
                        {
 
1288
                                gboolean _tmp31_;
 
1289
                                f = 0;
 
1290
                                _tmp31_ = TRUE;
 
1291
                                while (TRUE) {
 
1292
                                        gboolean _tmp32_;
 
1293
                                        gint _tmp34_;
 
1294
                                        gint _tmp35_;
 
1295
                                        gboolean _tmp36_ = FALSE;
 
1296
                                        GValue** _tmp37_;
 
1297
                                        gint _tmp37__length1;
 
1298
                                        gint _tmp38_;
 
1299
                                        GValue* _tmp39_;
 
1300
                                        gboolean _tmp49_;
 
1301
                                        _tmp32_ = _tmp31_;
 
1302
                                        if (!_tmp32_) {
 
1303
                                                gint _tmp33_;
 
1304
                                                _tmp33_ = f;
 
1305
                                                f = _tmp33_ + 1;
 
1306
                                        }
 
1307
                                        _tmp31_ = FALSE;
 
1308
                                        _tmp34_ = f;
 
1309
                                        _tmp35_ = fc;
 
1310
                                        if (!(_tmp34_ < _tmp35_)) {
 
1311
                                                break;
 
1312
                                        }
 
1313
                                        _tmp37_ = self->priv->cache;
 
1314
                                        _tmp37__length1 = self->priv->cache_length1;
 
1315
                                        _tmp38_ = f;
 
1316
                                        _tmp39_ = _tmp37_[_tmp38_];
 
1317
                                        if (_tmp39_ == NULL) {
 
1318
                                                _tmp36_ = TRUE;
 
1319
                                        } else {
 
1320
                                                GValue** _tmp40_;
 
1321
                                                gint _tmp40__length1;
 
1322
                                                gint _tmp41_;
 
1323
                                                GValue* _tmp42_;
 
1324
                                                GValueArray* _tmp43_;
 
1325
                                                GValue* _tmp44_;
 
1326
                                                gint _tmp44__length1;
 
1327
                                                gint _tmp45_;
 
1328
                                                GValue _tmp46_;
 
1329
                                                GValue _tmp47_;
 
1330
                                                gboolean _tmp48_ = FALSE;
 
1331
                                                _tmp40_ = self->priv->cache;
 
1332
                                                _tmp40__length1 = self->priv->cache_length1;
 
1333
                                                _tmp41_ = f;
 
1334
                                                _tmp42_ = _tmp40_[_tmp41_];
 
1335
                                                _tmp43_ = res;
 
1336
                                                _tmp44_ = _tmp43_->values;
 
1337
                                                _tmp44__length1 = (gint) _tmp43_->n_values;
 
1338
                                                _tmp45_ = f;
 
1339
                                                _tmp46_ = _tmp44_[_tmp45_];
 
1340
                                                _tmp47_ = *_tmp42_;
 
1341
                                                _tmp48_ = sql_heavy_value_equal (&_tmp47_, &_tmp46_);
 
1342
                                                _tmp36_ = !_tmp48_;
 
1343
                                        }
 
1344
                                        _tmp49_ = _tmp36_;
 
1345
                                        if (_tmp49_) {
 
1346
                                                gboolean* _tmp50_;
 
1347
                                                gint _tmp50__length1;
 
1348
                                                gint _tmp51_;
 
1349
                                                GValue** _tmp52_;
 
1350
                                                gint _tmp52__length1;
 
1351
                                                gint _tmp53_;
 
1352
                                                GValue* _tmp54_;
 
1353
                                                gboolean _tmp55_;
 
1354
                                                GValue** _tmp56_;
 
1355
                                                gint _tmp56__length1;
 
1356
                                                gint _tmp57_;
 
1357
                                                GValueArray* _tmp58_;
 
1358
                                                GValue* _tmp59_;
 
1359
                                                gint _tmp59__length1;
 
1360
                                                gint _tmp60_;
 
1361
                                                GValue _tmp61_;
 
1362
                                                GValue _tmp62_;
 
1363
                                                GValue* _tmp63_;
 
1364
                                                GValue* _tmp64_;
 
1365
                                                _tmp50_ = fields_changed;
 
1366
                                                _tmp50__length1 = fields_changed_length1;
 
1367
                                                _tmp51_ = f;
 
1368
                                                _tmp52_ = self->priv->cache;
 
1369
                                                _tmp52__length1 = self->priv->cache_length1;
 
1370
                                                _tmp53_ = f;
 
1371
                                                _tmp54_ = _tmp52_[_tmp53_];
 
1372
                                                _tmp50_[_tmp51_] = _tmp54_ != NULL;
 
1373
                                                _tmp55_ = _tmp50_[_tmp51_];
 
1374
                                                _tmp56_ = self->priv->cache;
 
1375
                                                _tmp56__length1 = self->priv->cache_length1;
 
1376
                                                _tmp57_ = f;
 
1377
                                                _tmp58_ = res;
 
1378
                                                _tmp59_ = _tmp58_->values;
 
1379
                                                _tmp59__length1 = (gint) _tmp58_->n_values;
 
1380
                                                _tmp60_ = f;
 
1381
                                                _tmp61_ = _tmp59_[_tmp60_];
 
1382
                                                _tmp62_ = _tmp61_;
 
1383
                                                _tmp63_ = __g_value_dup0 (&_tmp62_);
 
1384
                                                __vala_GValue_free0 (_tmp56_[_tmp57_]);
 
1385
                                                _tmp56_[_tmp57_] = _tmp63_;
 
1386
                                                _tmp64_ = _tmp56_[_tmp57_];
 
1387
                                        } else {
 
1388
                                                gboolean* _tmp65_;
 
1389
                                                gint _tmp65__length1;
 
1390
                                                gint _tmp66_;
 
1391
                                                gboolean _tmp67_;
 
1392
                                                _tmp65_ = fields_changed;
 
1393
                                                _tmp65__length1 = fields_changed_length1;
 
1394
                                                _tmp66_ = f;
 
1395
                                                _tmp65_[_tmp66_] = FALSE;
 
1396
                                                _tmp67_ = _tmp65_[_tmp66_];
 
1397
                                        }
 
1398
                                }
 
1399
                        }
 
1400
                        {
 
1401
                                gboolean _tmp68_;
 
1402
                                f = 0;
 
1403
                                _tmp68_ = TRUE;
 
1404
                                while (TRUE) {
 
1405
                                        gboolean _tmp69_;
 
1406
                                        gint _tmp71_;
 
1407
                                        gint _tmp72_;
 
1408
                                        gboolean* _tmp73_;
 
1409
                                        gint _tmp73__length1;
 
1410
                                        gint _tmp74_;
 
1411
                                        gboolean _tmp75_;
 
1412
                                        _tmp69_ = _tmp68_;
 
1413
                                        if (!_tmp69_) {
 
1414
                                                gint _tmp70_;
 
1415
                                                _tmp70_ = f;
 
1416
                                                f = _tmp70_ + 1;
 
1417
                                        }
 
1418
                                        _tmp68_ = FALSE;
 
1419
                                        _tmp71_ = f;
 
1420
                                        _tmp72_ = fc;
 
1421
                                        if (!(_tmp71_ < _tmp72_)) {
 
1422
                                                break;
 
1423
                                        }
 
1424
                                        _tmp73_ = fields_changed;
 
1425
                                        _tmp73__length1 = fields_changed_length1;
 
1426
                                        _tmp74_ = f;
 
1427
                                        _tmp75_ = _tmp73_[_tmp74_];
 
1428
                                        if (_tmp75_) {
 
1429
                                                gint _tmp76_;
 
1430
                                                _tmp76_ = f;
 
1431
                                                g_signal_emit_by_name (self, "field-changed", _tmp76_);
 
1432
                                        }
 
1433
                                }
 
1434
                        }
 
1435
                        fields_changed = (g_free (fields_changed), NULL);
 
1436
                        _g_value_array_free0 (res);
 
1437
                        _g_object_unref0 (query);
 
1438
                }
995
1439
                __finally30:
996
 
                g_static_rec_mutex_unlock (&self->priv->__lock_cache);
 
1440
                {
 
1441
                        GValue** _tmp77_;
 
1442
                        gint _tmp77__length1;
 
1443
                        _tmp77_ = self->priv->cache;
 
1444
                        _tmp77__length1 = self->priv->cache_length1;
 
1445
                        g_static_rec_mutex_unlock (&self->priv->__lock_cache);
 
1446
                }
997
1447
                if (_inner_error_ != NULL) {
998
1448
                        if (_inner_error_->domain == SQL_HEAVY_ERROR) {
999
1449
                                g_propagate_error (error, _inner_error_);
1018
1468
gint sql_heavy_row_compare (SQLHeavyRow* a, SQLHeavyRow* b) {
1019
1469
        gint result = 0;
1020
1470
        gint r;
1021
 
        gint _tmp0_;
1022
 
        gint64 _tmp1_;
1023
 
        gint64 _tmp2_;
1024
 
        gint64 _tmp3_;
1025
 
        gint _tmp4_;
 
1471
        SQLHeavyRow* _tmp0_;
 
1472
        SQLHeavyRow* _tmp1_;
 
1473
        SQLHeavyRow* _tmp2_;
 
1474
        SQLHeavyRow* _tmp3_;
 
1475
        SQLHeavyRow* _tmp4_;
 
1476
        SQLHeavyTable* _tmp5_;
 
1477
        SQLHeavyRow* _tmp6_;
 
1478
        SQLHeavyTable* _tmp7_;
 
1479
        gint _tmp8_ = 0;
 
1480
        gint _tmp9_;
 
1481
        SQLHeavyRow* _tmp10_;
 
1482
        gint64 _tmp11_;
 
1483
        gint64 _tmp12_;
 
1484
        SQLHeavyRow* _tmp13_;
 
1485
        gint64 _tmp14_;
 
1486
        gint64 _tmp15_;
 
1487
        gint _tmp16_;
 
1488
        gint _tmp17_;
 
1489
        gint64 _tmp18_ = 0LL;
 
1490
        gint _tmp19_;
 
1491
        SQLHeavyRow* _tmp20_;
 
1492
        SQLHeavyRow* _tmp21_;
 
1493
        gint _tmp22_ = 0;
1026
1494
        r = 0;
1027
 
        if (a == b) {
 
1495
        _tmp0_ = a;
 
1496
        _tmp1_ = b;
 
1497
        if (_tmp0_ == _tmp1_) {
1028
1498
                result = 0;
1029
1499
                return result;
1030
1500
        }
1031
 
        if (a == NULL) {
 
1501
        _tmp2_ = a;
 
1502
        if (_tmp2_ == NULL) {
1032
1503
                result = -1;
1033
1504
                return result;
1034
1505
        }
1035
 
        if (b == NULL) {
 
1506
        _tmp3_ = b;
 
1507
        if (_tmp3_ == NULL) {
1036
1508
                result = 1;
1037
1509
                return result;
1038
1510
        }
1039
 
        _tmp0_ = sql_heavy_table_compare (a->priv->_table, b->priv->_table);
1040
 
        r = _tmp0_;
1041
 
        if (r != 0) {
1042
 
                result = r;
1043
 
                return result;
1044
 
        }
1045
 
        _tmp1_ = sql_heavy_row_get_id (a);
1046
 
        _tmp2_ = sql_heavy_row_get_id (b);
1047
 
        _tmp3_ = CLAMP (_tmp1_ - _tmp2_, (gint64) G_MININT, (gint64) G_MAXINT);
1048
 
        r = (gint) _tmp3_;
1049
 
        if (r != 0) {
1050
 
                result = r;
1051
 
                return result;
1052
 
        }
1053
 
        _tmp4_ = sql_heavy_row_direct_compare (a, b);
1054
 
        result = _tmp4_;
 
1511
        _tmp4_ = a;
 
1512
        _tmp5_ = _tmp4_->priv->_table;
 
1513
        _tmp6_ = b;
 
1514
        _tmp7_ = _tmp6_->priv->_table;
 
1515
        _tmp8_ = sql_heavy_table_compare (_tmp5_, _tmp7_);
 
1516
        r = _tmp8_;
 
1517
        _tmp9_ = r;
 
1518
        if (_tmp9_ != 0) {
 
1519
                result = r;
 
1520
                return result;
 
1521
        }
 
1522
        _tmp10_ = a;
 
1523
        _tmp11_ = sql_heavy_row_get_id (_tmp10_);
 
1524
        _tmp12_ = _tmp11_;
 
1525
        _tmp13_ = b;
 
1526
        _tmp14_ = sql_heavy_row_get_id (_tmp13_);
 
1527
        _tmp15_ = _tmp14_;
 
1528
        _tmp16_ = G_MININT;
 
1529
        _tmp17_ = G_MAXINT;
 
1530
        _tmp18_ = CLAMP (_tmp12_ - _tmp15_, (gint64) _tmp16_, (gint64) _tmp17_);
 
1531
        r = (gint) _tmp18_;
 
1532
        _tmp19_ = r;
 
1533
        if (_tmp19_ != 0) {
 
1534
                result = r;
 
1535
                return result;
 
1536
        }
 
1537
        _tmp20_ = a;
 
1538
        _tmp21_ = b;
 
1539
        _tmp22_ = sql_heavy_row_direct_compare (_tmp20_, _tmp21_);
 
1540
        result = _tmp22_;
1055
1541
        return result;
1056
1542
}
1057
1543
 
1065
1551
     */
1066
1552
gint sql_heavy_row_direct_compare (SQLHeavyRow* a, SQLHeavyRow* b) {
1067
1553
        gint result = 0;
1068
 
        result = (gint) (((gulong) a) - ((gulong) b));
 
1554
        SQLHeavyRow* _tmp0_;
 
1555
        SQLHeavyRow* _tmp1_;
 
1556
        _tmp0_ = a;
 
1557
        _tmp1_ = b;
 
1558
        result = (gint) (((gulong) _tmp0_) - ((gulong) _tmp1_));
1069
1559
        return result;
1070
1560
}
1071
1561
 
1081
1571
     */
1082
1572
SQLHeavyRow* sql_heavy_row_construct (GType object_type, SQLHeavyTable* table, gint64 id) {
1083
1573
        SQLHeavyRow * self = NULL;
 
1574
        SQLHeavyTable* _tmp0_;
 
1575
        gint64 _tmp1_;
1084
1576
        g_return_val_if_fail (table != NULL, NULL);
1085
 
        self = (SQLHeavyRow*) g_object_new (object_type, "table", table, "id", id, NULL);
 
1577
        _tmp0_ = table;
 
1578
        _tmp1_ = id;
 
1579
        self = (SQLHeavyRow*) g_object_new (object_type, "table", _tmp0_, "id", _tmp1_, NULL);
1086
1580
        return self;
1087
1581
}
1088
1582
 
1094
1588
 
1095
1589
SQLHeavyTable* sql_heavy_row_get_table (SQLHeavyRow* self) {
1096
1590
        SQLHeavyTable* result;
 
1591
        SQLHeavyTable* _tmp0_;
1097
1592
        g_return_val_if_fail (self != NULL, NULL);
1098
 
        result = self->priv->_table;
 
1593
        _tmp0_ = self->priv->_table;
 
1594
        result = _tmp0_;
1099
1595
        return result;
1100
1596
}
1101
1597
 
1107
1603
 
1108
1604
static void sql_heavy_row_set_table (SQLHeavyRow* self, SQLHeavyTable* value) {
1109
1605
        SQLHeavyTable* _tmp0_;
 
1606
        SQLHeavyTable* _tmp1_;
1110
1607
        g_return_if_fail (self != NULL);
1111
 
        _tmp0_ = _g_object_ref0 (value);
 
1608
        _tmp0_ = value;
 
1609
        _tmp1_ = _g_object_ref0 (_tmp0_);
1112
1610
        _g_object_unref0 (self->priv->_table);
1113
 
        self->priv->_table = _tmp0_;
 
1611
        self->priv->_table = _tmp1_;
1114
1612
        g_object_notify ((GObject *) self, "table");
1115
1613
}
1116
1614
 
1117
1615
 
1118
1616
gboolean sql_heavy_row_get_auto_save (SQLHeavyRow* self) {
1119
1617
        gboolean result;
 
1618
        gboolean _tmp0_;
1120
1619
        g_return_val_if_fail (self != NULL, FALSE);
1121
 
        result = self->priv->_auto_save;
 
1620
        _tmp0_ = self->priv->_auto_save;
 
1621
        result = _tmp0_;
1122
1622
        return result;
1123
1623
}
1124
1624
 
1125
1625
 
1126
1626
void sql_heavy_row_set_auto_save (SQLHeavyRow* self, gboolean value) {
 
1627
        gboolean _tmp0_;
1127
1628
        g_return_if_fail (self != NULL);
1128
 
        self->priv->_auto_save = value;
 
1629
        _tmp0_ = value;
 
1630
        self->priv->_auto_save = _tmp0_;
1129
1631
        g_object_notify ((GObject *) self, "auto-save");
1130
1632
}
1131
1633
 
1132
1634
 
1133
1635
gint64 sql_heavy_row_get_id (SQLHeavyRow* self) {
1134
1636
        gint64 result;
 
1637
        gint64 _tmp0_;
1135
1638
        g_return_val_if_fail (self != NULL, 0LL);
1136
 
        result = self->priv->_id;
 
1639
        _tmp0_ = self->priv->_id;
 
1640
        result = _tmp0_;
1137
1641
        return result;
1138
1642
}
1139
1643
 
1140
1644
 
1141
1645
static void sql_heavy_row_set_id (SQLHeavyRow* self, gint64 value) {
 
1646
        gint64 _tmp0_;
1142
1647
        g_return_if_fail (self != NULL);
1143
 
        self->priv->_id = value;
 
1648
        _tmp0_ = value;
 
1649
        self->priv->_id = _tmp0_;
1144
1650
        g_object_notify ((GObject *) self, "id");
1145
1651
}
1146
1652
 
1148
1654
static gint sql_heavy_row_real_get_field_count (SQLHeavyRecord* base) {
1149
1655
        gint result;
1150
1656
        SQLHeavyRow* self;
1151
 
        gint _tmp0_;
 
1657
        SQLHeavyTable* _tmp0_;
 
1658
        gint _tmp1_;
 
1659
        gint _tmp2_;
1152
1660
        self = (SQLHeavyRow*) base;
1153
 
        _tmp0_ = sql_heavy_table_get_field_count (self->priv->_table);
1154
 
        result = _tmp0_;
 
1661
        _tmp0_ = self->priv->_table;
 
1662
        _tmp1_ = sql_heavy_table_get_field_count (_tmp0_);
 
1663
        _tmp2_ = _tmp1_;
 
1664
        result = _tmp2_;
1155
1665
        return result;
1156
1666
}
1157
1667
 
1158
1668
 
1159
1669
gboolean sql_heavy_row_get_enable_cache (SQLHeavyRow* self) {
1160
1670
        gboolean result;
 
1671
        gboolean _tmp0_;
1161
1672
        g_return_val_if_fail (self != NULL, FALSE);
1162
 
        result = self->priv->_enable_cache;
 
1673
        _tmp0_ = self->priv->_enable_cache;
 
1674
        result = _tmp0_;
1163
1675
        return result;
1164
1676
}
1165
1677
 
1166
1678
 
1167
1679
void sql_heavy_row_set_enable_cache (SQLHeavyRow* self, gboolean value) {
 
1680
        gboolean _tmp0_;
1168
1681
        g_return_if_fail (self != NULL);
1169
 
        self->priv->_enable_cache = value;
 
1682
        _tmp0_ = value;
 
1683
        self->priv->_enable_cache = _tmp0_;
1170
1684
        g_object_notify ((GObject *) self, "enable-cache");
1171
1685
}
1172
1686
 
1173
1687
 
1174
 
static void _lambda2_ (SQLHeavyRow* self) {
1175
 
        SQLHeavyQueryable* _tmp0_ = NULL;
1176
 
        SQLHeavyDatabase* _tmp1_ = NULL;
1177
 
        SQLHeavyDatabase* _tmp2_;
1178
 
        _tmp0_ = sql_heavy_table_get_queryable (self->priv->_table);
1179
 
        _tmp1_ = sql_heavy_queryable_get_database (_tmp0_);
 
1688
static void _sql_heavy_row___lambda4_ (SQLHeavyRow* self) {
 
1689
        SQLHeavyTable* _tmp0_;
 
1690
        SQLHeavyQueryable* _tmp1_;
 
1691
        SQLHeavyQueryable* _tmp2_;
 
1692
        SQLHeavyDatabase* _tmp3_;
 
1693
        SQLHeavyDatabase* _tmp4_;
 
1694
        SQLHeavyDatabase* _tmp5_;
 
1695
        _tmp0_ = self->priv->_table;
 
1696
        _tmp1_ = sql_heavy_table_get_queryable (_tmp0_);
1180
1697
        _tmp2_ = _tmp1_;
1181
 
        sql_heavy_database_add_step_unlock_notify_row (_tmp2_, self);
1182
 
        _g_object_unref0 (_tmp2_);
1183
 
}
1184
 
 
1185
 
 
1186
 
static void __lambda2__sql_heavy_row_changed (SQLHeavyRow* _sender, gpointer self) {
1187
 
        _lambda2_ (self);
1188
 
}
1189
 
 
1190
 
 
1191
 
static void _lambda3_ (GParamSpec* pspec, SQLHeavyRow* self) {
 
1698
        _tmp3_ = sql_heavy_queryable_get_database (_tmp2_);
 
1699
        _tmp4_ = _tmp3_;
 
1700
        _tmp5_ = _tmp4_;
 
1701
        sql_heavy_database_add_step_unlock_notify_row (_tmp5_, self);
 
1702
        _g_object_unref0 (_tmp5_);
 
1703
}
 
1704
 
 
1705
 
 
1706
static void __sql_heavy_row___lambda4__sql_heavy_row_changed (SQLHeavyRow* _sender, gpointer self) {
 
1707
        _sql_heavy_row___lambda4_ (self);
 
1708
}
 
1709
 
 
1710
 
 
1711
static void _sql_heavy_row___lambda5_ (SQLHeavyRow* self, GParamSpec* pspec) {
1192
1712
        GError * _inner_error_ = NULL;
1193
1713
        g_return_if_fail (pspec != NULL);
1194
 
        sql_heavy_row_update_cache (self, &_inner_error_);
1195
 
        if (_inner_error_ != NULL) {
1196
 
                if (_inner_error_->domain == SQL_HEAVY_ERROR) {
1197
 
                        goto __catch32_sql_heavy_error;
 
1714
        {
 
1715
                sql_heavy_row_update_cache (self, &_inner_error_);
 
1716
                if (_inner_error_ != NULL) {
 
1717
                        if (_inner_error_->domain == SQL_HEAVY_ERROR) {
 
1718
                                goto __catch32_sql_heavy_error;
 
1719
                        }
 
1720
                        g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
 
1721
                        g_clear_error (&_inner_error_);
 
1722
                        return;
1198
1723
                }
1199
 
                g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
1200
 
                g_clear_error (&_inner_error_);
1201
 
                return;
1202
1724
        }
1203
1725
        goto __finally32;
1204
1726
        __catch32_sql_heavy_error:
1205
1727
        {
1206
 
                GError * e;
 
1728
                GError* e = NULL;
1207
1729
                const gchar* _tmp0_ = NULL;
 
1730
                gboolean _tmp1_;
 
1731
                const gchar* _tmp2_;
 
1732
                GError* _tmp3_;
 
1733
                const gchar* _tmp4_;
1208
1734
                e = _inner_error_;
1209
1735
                _inner_error_ = NULL;
1210
 
                if (self->priv->_enable_cache) {
 
1736
                _tmp1_ = self->priv->_enable_cache;
 
1737
                if (_tmp1_) {
1211
1738
                        _tmp0_ = "enable";
1212
1739
                } else {
1213
1740
                        _tmp0_ = "disable";
1214
1741
                }
1215
 
                g_warning ("sqlheavy-row.vala:336: Unable to %s cache: %s", _tmp0_, e->message);
 
1742
                _tmp2_ = _tmp0_;
 
1743
                _tmp3_ = e;
 
1744
                _tmp4_ = _tmp3_->message;
 
1745
                g_warning ("sqlheavy-row.vala:336: Unable to %s cache: %s", _tmp2_, _tmp4_);
1216
1746
                _g_error_free0 (e);
1217
1747
        }
1218
1748
        __finally32:
1224
1754
}
1225
1755
 
1226
1756
 
1227
 
static void __lambda3__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
1228
 
        _lambda3_ (pspec, self);
 
1757
static void __sql_heavy_row___lambda5__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
 
1758
        _sql_heavy_row___lambda5_ (self, pspec);
1229
1759
}
1230
1760
 
1231
1761
 
1233
1763
        GObject * obj;
1234
1764
        GObjectClass * parent_class;
1235
1765
        SQLHeavyRow * self;
 
1766
        gint64 _tmp0_;
 
1767
        gboolean _tmp2_;
1236
1768
        GError * _inner_error_ = NULL;
1237
1769
        parent_class = G_OBJECT_CLASS (sql_heavy_row_parent_class);
1238
1770
        obj = parent_class->constructor (type, n_construct_properties, construct_properties);
1239
1771
        self = SQL_HEAVY_ROW (obj);
1240
 
        if (self->priv->_id != 0) {
1241
 
                sql_heavy_table_register_row (self->priv->_table, self);
 
1772
        _tmp0_ = self->priv->_id;
 
1773
        if (_tmp0_ != ((gint64) 0)) {
 
1774
                SQLHeavyTable* _tmp1_;
 
1775
                _tmp1_ = self->priv->_table;
 
1776
                sql_heavy_table_register_row (_tmp1_, self);
1242
1777
        }
1243
 
        if (self->priv->_enable_cache) {
1244
 
                sql_heavy_row_update_cache (self, &_inner_error_);
1245
 
                if (_inner_error_ != NULL) {
1246
 
                        if (_inner_error_->domain == SQL_HEAVY_ERROR) {
1247
 
                                goto __catch31_sql_heavy_error;
 
1778
        _tmp2_ = self->priv->_enable_cache;
 
1779
        if (_tmp2_) {
 
1780
                {
 
1781
                        sql_heavy_row_update_cache (self, &_inner_error_);
 
1782
                        if (_inner_error_ != NULL) {
 
1783
                                if (_inner_error_->domain == SQL_HEAVY_ERROR) {
 
1784
                                        goto __catch31_sql_heavy_error;
 
1785
                                }
 
1786
                                g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
 
1787
                                g_clear_error (&_inner_error_);
1248
1788
                        }
1249
 
                        g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
1250
 
                        g_clear_error (&_inner_error_);
1251
1789
                }
1252
1790
                goto __finally31;
1253
1791
                __catch31_sql_heavy_error:
1254
1792
                {
1255
 
                        GError * e;
 
1793
                        GError* e = NULL;
 
1794
                        GError* _tmp3_;
 
1795
                        const gchar* _tmp4_;
1256
1796
                        e = _inner_error_;
1257
1797
                        _inner_error_ = NULL;
1258
 
                        g_warning ("sqlheavy-row.vala:324: Unable to initialize cache: %s", e->message);
 
1798
                        _tmp3_ = e;
 
1799
                        _tmp4_ = _tmp3_->message;
 
1800
                        g_warning ("sqlheavy-row.vala:324: Unable to initialize cache: %s", _tmp4_);
1259
1801
                        _g_error_free0 (e);
1260
1802
                }
1261
1803
                __finally31:
1264
1806
                        g_clear_error (&_inner_error_);
1265
1807
                }
1266
1808
        }
1267
 
        g_signal_connect_object (self, "changed", (GCallback) __lambda2__sql_heavy_row_changed, self, 0);
1268
 
        g_signal_connect_object ((GObject*) self, "notify::enable-cache", (GCallback) __lambda3__g_object_notify, self, 0);
 
1809
        g_signal_connect_object (self, "changed", (GCallback) __sql_heavy_row___lambda4__sql_heavy_row_changed, self, 0);
 
1810
        g_signal_connect_object ((GObject*) self, "notify::enable-cache", (GCallback) __sql_heavy_row___lambda5__g_object_notify, self, 0);
1269
1811
        return obj;
1270
1812
}
1271
1813
 
1292
1834
        /**
1293
1835
             * {@inheritDoc}
1294
1836
             */
1295
 
        g_object_class_override_property (G_OBJECT_CLASS (klass), SQL_HEAVY_ROW_FIELD_COUNT, "field-count");
 
1837
        g_object_class_install_property (G_OBJECT_CLASS (klass), SQL_HEAVY_ROW_FIELD_COUNT, g_param_spec_int ("field-count", "field-count", "field-count", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
1296
1838
        /**
1297
1839
             * Whether or not to enable caching for this row
1298
1840
             *
1322
1864
 
1323
1865
static void sql_heavy_row_sql_heavy_record_interface_init (SQLHeavyRecordIface * iface) {
1324
1866
        sql_heavy_row_sql_heavy_record_parent_iface = g_type_interface_peek_parent (iface);
1325
 
        iface->field_index = (gint (*)(SQLHeavyRecord* ,const gchar* ,GError**)) sql_heavy_row_real_field_index;
1326
 
        iface->field_name = (gchar* (*)(SQLHeavyRecord* ,gint ,GError**)) sql_heavy_row_real_field_name;
1327
 
        iface->field_type = (GType (*)(SQLHeavyRecord* ,gint ,GError**)) sql_heavy_row_real_field_type;
1328
 
        iface->fetch = (GValue (*)(SQLHeavyRecord* ,gint ,GValue* ,GError**)) sql_heavy_row_real_fetch;
1329
 
        iface->fetch_foreign_row = (SQLHeavyRow* (*)(SQLHeavyRecord* ,gint ,GError**)) sql_heavy_row_real_fetch_foreign_row;
1330
 
        iface->get_foreign_row = (SQLHeavyRow* (*)(SQLHeavyRecord* ,const gchar* ,GError**)) sql_heavy_row_real_get_foreign_row;
 
1867
        iface->field_index = (gint (*)(SQLHeavyRecord*, const gchar*, GError**)) sql_heavy_row_real_field_index;
 
1868
        iface->field_name = (gchar* (*)(SQLHeavyRecord*, gint, GError**)) sql_heavy_row_real_field_name;
 
1869
        iface->field_type = (GType (*)(SQLHeavyRecord*, gint, GError**)) sql_heavy_row_real_field_type;
 
1870
        iface->fetch = (void (*)(SQLHeavyRecord*, gint, GValue*, GError**)) sql_heavy_row_real_fetch;
 
1871
        iface->fetch_foreign_row = (SQLHeavyRow* (*)(SQLHeavyRecord*, gint, GError**)) sql_heavy_row_real_fetch_foreign_row;
 
1872
        iface->get_foreign_row = (SQLHeavyRow* (*)(SQLHeavyRecord*, const gchar*, GError**)) sql_heavy_row_real_get_foreign_row;
1331
1873
        iface->get_field_count = sql_heavy_row_real_get_field_count;
1332
1874
}
1333
1875
 
1334
1876
 
1335
1877
static void sql_heavy_row_sql_heavy_mutable_record_interface_init (SQLHeavyMutableRecordIface * iface) {
1336
1878
        sql_heavy_row_sql_heavy_mutable_record_parent_iface = g_type_interface_peek_parent (iface);
1337
 
        iface->save = (void (*)(SQLHeavyMutableRecord* ,GError**)) sql_heavy_row_real_save;
1338
 
        iface->put = (void (*)(SQLHeavyMutableRecord* ,gint ,GValue* ,GError**)) sql_heavy_row_real_put;
1339
 
        iface->delete = (void (*)(SQLHeavyMutableRecord* ,GError**)) sql_heavy_row_real_delete;
 
1879
        iface->save = (void (*)(SQLHeavyMutableRecord*, GError**)) sql_heavy_row_real_save;
 
1880
        iface->put = (void (*)(SQLHeavyMutableRecord*, gint, GValue*, GError**)) sql_heavy_row_real_put;
 
1881
        iface->delete = (void (*)(SQLHeavyMutableRecord*, GError**)) sql_heavy_row_real_delete;
1340
1882
}
1341
1883
 
1342
1884
 
1354
1896
 
1355
1897
static void sql_heavy_row_finalize (GObject* obj) {
1356
1898
        SQLHeavyRow * self;
 
1899
        gboolean _tmp0_;
 
1900
        SQLHeavyTable* _tmp1_;
1357
1901
        GError * _inner_error_ = NULL;
1358
1902
        self = SQL_HEAVY_ROW (obj);
1359
 
        if (self->priv->_auto_save) {
 
1903
        _tmp0_ = self->priv->_auto_save;
 
1904
        if (_tmp0_) {
1360
1905
                sql_heavy_mutable_record_save ((SQLHeavyMutableRecord*) self, &_inner_error_);
1361
1906
                if (_inner_error_ != NULL) {
1362
1907
                        g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
1363
1908
                        g_clear_error (&_inner_error_);
1364
1909
                }
1365
1910
        }
1366
 
        sql_heavy_table_unregister_row (self->priv->_table, self);
 
1911
        _tmp1_ = self->priv->_table;
 
1912
        sql_heavy_table_unregister_row (_tmp1_, self);
1367
1913
        _g_object_unref0 (self->priv->_table);
1368
1914
        g_static_rec_mutex_free (&self->priv->__lock_values);
1369
1915
        self->priv->values = (_vala_array_free (self->priv->values, self->priv->values_length1, (GDestroyNotify) _vala_GValue_free), NULL);