SQLite

Check-in [c6fca0be11]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Make the sqlite3_value_subtype() and sqlite3_result_subtype() interfaces available to loadable extensions.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | subtypes
Files: files | file ages | folders
SHA1: c6fca0be11f7414292279e2ea1b004260e6f4bb6
User & Date: drh 2015-09-10 20:40:21.038
Context
2015-09-11
00:06
Take out the goofy '$$' path syntax. Instead, use subtypes to communicate when a string is JSON. Add the json() function that validates and minifies the JSON and sets the appropriate subtype. (Closed-Leaf check-in: 8a80d6459e user: drh tags: subtypes)
2015-09-10
20:40
Make the sqlite3_value_subtype() and sqlite3_result_subtype() interfaces available to loadable extensions. (check-in: c6fca0be11 user: drh tags: subtypes)
20:34
Experimental implementation of sqlite3_result_subtype() and sqlite3_value_subtype() interfaces. (check-in: 7b5be299c6 user: drh tags: subtypes)
Changes
Side-by-Side Diff Ignore Whitespace Patch
Changes to src/loadext.c.
403
404
405
406
407
408
409
410




411
412
413
414
415
416
417
403
404
405
406
407
408
409

410
411
412
413
414
415
416
417
418
419
420







-
+
+
+
+







  sqlite3_result_blob64,
  sqlite3_result_text64,
  sqlite3_strglob,
  /* Version 3.8.11 and later */
  (sqlite3_value*(*)(const sqlite3_value*))sqlite3_value_dup,
  sqlite3_value_free,
  sqlite3_result_zeroblob64,
  sqlite3_bind_zeroblob64
  sqlite3_bind_zeroblob64,
  /* Version 3.8.12 and later */
  sqlite3_value_subtype,
  sqlite3_result_subtype
};

/*
** Attempt to load an SQLite extension library contained in the file
** zFile.  The entry point is zProc.  zProc may be 0 in which case a
** default entry point name (sqlite3_extension_init) is used.  Use
** of the default name is recommended.
Changes to src/sqlite3ext.h.
268
269
270
271
272
273
274



275
276
277
278
279
280
281
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284







+
+
+







                         void(*)(void*), unsigned char);
  int (*strglob)(const char*,const char*);
  /* Version 3.8.11 and later */
  sqlite3_value *(*value_dup)(const sqlite3_value*);
  void (*value_free)(sqlite3_value*);
  int (*result_zeroblob64)(sqlite3_context*,sqlite3_uint64);
  int (*bind_zeroblob64)(sqlite3_stmt*, int, sqlite3_uint64);
  /* Version 3.8.12 and later */
  unsigned int (*value_subtype)(sqlite3_value*);
  void (*result_subtype)(sqlite3_context*,unsigned int);
};

/*
** The following macros redefine the API routines so that they are
** redirected through the global sqlite3_api structure.
**
** This header file is also used by the loadext.c source file
504
505
506
507
508
509
510



511
512
513
514
515
516
517
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523







+
+
+







#define sqlite3_result_text64          sqlite3_api->result_text64
#define sqlite3_strglob                sqlite3_api->strglob
/* Version 3.8.11 and later */
#define sqlite3_value_dup              sqlite3_api->value_dup
#define sqlite3_value_free             sqlite3_api->value_free
#define sqlite3_result_zeroblob64      sqlite3_api->result_zeroblob64
#define sqlite3_bind_zeroblob64        sqlite3_api->bind_zeroblob64
/* Version 3.8.12 and later */
#define sqlite3_value_subtype          sqlite3_api->value_subtype
#define sqlite3_result_subtype         sqlite3_api->result_subtype
#endif /* !defined(SQLITE_CORE) && !defined(SQLITE_OMIT_LOAD_EXTENSION) */

#if !defined(SQLITE_CORE) && !defined(SQLITE_OMIT_LOAD_EXTENSION)
  /* This case when the file really is being compiled as a loadable 
  ** extension */
# define SQLITE_EXTENSION_INIT1     const sqlite3_api_routines *sqlite3_api=0;
# define SQLITE_EXTENSION_INIT2(v)  sqlite3_api=v;