/ Check-in [c6fca0be]
Login
SQLite training in Houston TX on 2019-11-05 (details)
Part of the 2019 Tcl Conference

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 | SQL archive
Timelines: family | ancestors | descendants | both | subtypes
Files: files | file ages | folders
SHA1: c6fca0be11f7414292279e2ea1b004260e6f4bb6
User & Date: drh 2015-09-10 20:40:21
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: 8a80d645 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: c6fca0be user: drh tags: subtypes
20:34
Experimental implementation of sqlite3_result_subtype() and sqlite3_value_subtype() interfaces. check-in: 7b5be299 user: drh tags: subtypes
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/loadext.c.

   403    403     sqlite3_result_blob64,
   404    404     sqlite3_result_text64,
   405    405     sqlite3_strglob,
   406    406     /* Version 3.8.11 and later */
   407    407     (sqlite3_value*(*)(const sqlite3_value*))sqlite3_value_dup,
   408    408     sqlite3_value_free,
   409    409     sqlite3_result_zeroblob64,
   410         -  sqlite3_bind_zeroblob64
          410  +  sqlite3_bind_zeroblob64,
          411  +  /* Version 3.8.12 and later */
          412  +  sqlite3_value_subtype,
          413  +  sqlite3_result_subtype
   411    414   };
   412    415   
   413    416   /*
   414    417   ** Attempt to load an SQLite extension library contained in the file
   415    418   ** zFile.  The entry point is zProc.  zProc may be 0 in which case a
   416    419   ** default entry point name (sqlite3_extension_init) is used.  Use
   417    420   ** of the default name is recommended.

Changes to src/sqlite3ext.h.

   268    268                            void(*)(void*), unsigned char);
   269    269     int (*strglob)(const char*,const char*);
   270    270     /* Version 3.8.11 and later */
   271    271     sqlite3_value *(*value_dup)(const sqlite3_value*);
   272    272     void (*value_free)(sqlite3_value*);
   273    273     int (*result_zeroblob64)(sqlite3_context*,sqlite3_uint64);
   274    274     int (*bind_zeroblob64)(sqlite3_stmt*, int, sqlite3_uint64);
          275  +  /* Version 3.8.12 and later */
          276  +  unsigned int (*value_subtype)(sqlite3_value*);
          277  +  void (*result_subtype)(sqlite3_context*,unsigned int);
   275    278   };
   276    279   
   277    280   /*
   278    281   ** The following macros redefine the API routines so that they are
   279    282   ** redirected through the global sqlite3_api structure.
   280    283   **
   281    284   ** This header file is also used by the loadext.c source file
................................................................................
   504    507   #define sqlite3_result_text64          sqlite3_api->result_text64
   505    508   #define sqlite3_strglob                sqlite3_api->strglob
   506    509   /* Version 3.8.11 and later */
   507    510   #define sqlite3_value_dup              sqlite3_api->value_dup
   508    511   #define sqlite3_value_free             sqlite3_api->value_free
   509    512   #define sqlite3_result_zeroblob64      sqlite3_api->result_zeroblob64
   510    513   #define sqlite3_bind_zeroblob64        sqlite3_api->bind_zeroblob64
          514  +/* Version 3.8.12 and later */
          515  +#define sqlite3_value_subtype          sqlite3_api->value_subtype
          516  +#define sqlite3_result_subtype         sqlite3_api->result_subtype
   511    517   #endif /* !defined(SQLITE_CORE) && !defined(SQLITE_OMIT_LOAD_EXTENSION) */
   512    518   
   513    519   #if !defined(SQLITE_CORE) && !defined(SQLITE_OMIT_LOAD_EXTENSION)
   514    520     /* This case when the file really is being compiled as a loadable 
   515    521     ** extension */
   516    522   # define SQLITE_EXTENSION_INIT1     const sqlite3_api_routines *sqlite3_api=0;
   517    523   # define SQLITE_EXTENSION_INIT2(v)  sqlite3_api=v;