/ Check-in [5bb9e6a9]
Login

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

Overview
Comment:Merge from trunk the ability to use sqlite3_sql interfaces in extensions.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | geojson
Files: files | file ages | folders
SHA3-256: 5bb9e6a9f19f9d73314b08afbecb13f46b0cf7b27bfb567960d8f60e3a7a74a1
User & Date: drh 2018-05-09 15:19:41
Context
2018-05-09
15:20
Fix the geopoly_json() SQL function so that it works. check-in: 236588d5 user: drh tags: geojson
15:19
Merge from trunk the ability to use sqlite3_sql interfaces in extensions. check-in: 5bb9e6a9 user: drh tags: geojson
15:17
Add 14 new interfaces to the loadable extension mechanism. check-in: 0e809cdc user: drh tags: trunk
15:00
Add the geopoly_json() interface. Untested. check-in: 25695c80 user: drh tags: geojson
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/loadext.c.

   430    430     sqlite3_prepare16_v3,
   431    431     sqlite3_bind_pointer,
   432    432     sqlite3_result_pointer,
   433    433     sqlite3_value_pointer,
   434    434     /* Version 3.22.0 and later */
   435    435     sqlite3_vtab_nochange,
   436    436     sqlite3_value_nochange,
   437         -  sqlite3_vtab_collation
          437  +  sqlite3_vtab_collation,
          438  +  /* Version 3.24.0 and later */
          439  +  sqlite3_keyword_count,
          440  +  sqlite3_keyword_name,
          441  +  sqlite3_keyword_check,
          442  +  sqlite3_str_new,
          443  +  sqlite3_str_finish,
          444  +  sqlite3_str_appendf,
          445  +  sqlite3_str_vappendf,
          446  +  sqlite3_str_append,
          447  +  sqlite3_str_appendall,
          448  +  sqlite3_str_appendchar,
          449  +  sqlite3_str_reset,
          450  +  sqlite3_str_errcode,
          451  +  sqlite3_str_length,
          452  +  sqlite3_str_value
   438    453   };
   439    454   
   440    455   /*
   441    456   ** Attempt to load an SQLite extension library contained in the file
   442    457   ** zFile.  The entry point is zProc.  zProc may be 0 in which case a
   443    458   ** default entry point name (sqlite3_extension_init) is used.  Use
   444    459   ** of the default name is recommended.

Changes to src/sqlite3ext.h.

   291    291                         sqlite3_stmt**,const void**);
   292    292     int (*bind_pointer)(sqlite3_stmt*,int,void*,const char*,void(*)(void*));
   293    293     void (*result_pointer)(sqlite3_context*,void*,const char*,void(*)(void*));
   294    294     void *(*value_pointer)(sqlite3_value*,const char*);
   295    295     int (*vtab_nochange)(sqlite3_context*);
   296    296     int (*value_nochange)(sqlite3_value*);
   297    297     const char *(*vtab_collation)(sqlite3_index_info*,int);
          298  +  /* Version 3.24.0 and later */
          299  +  int (*keyword_count)(void);
          300  +  int (*keyword_name)(int,const char**,int*);
          301  +  int (*keyword_check)(const char*,int);
          302  +  sqlite3_str *(*str_new)(sqlite3*);
          303  +  char *(*str_finish)(sqlite3_str*);
          304  +  void (*str_appendf)(sqlite3_str*, const char *zFormat, ...);
          305  +  void (*str_vappendf)(sqlite3_str*, const char *zFormat, va_list);
          306  +  void (*str_append)(sqlite3_str*, const char *zIn, int N);
          307  +  void (*str_appendall)(sqlite3_str*, const char *zIn);
          308  +  void (*str_appendchar)(sqlite3_str*, int N, char C);
          309  +  void (*str_reset)(sqlite3_str*);
          310  +  int (*str_errcode)(sqlite3_str*);
          311  +  int (*str_length)(sqlite3_str*);
          312  +  char *(*str_value)(sqlite3_str*);
   298    313   };
   299    314   
   300    315   /*
   301    316   ** This is the function signature used for all extension entry points.  It
   302    317   ** is also defined in the file "loadext.c".
   303    318   */
   304    319   typedef int (*sqlite3_loadext_entry)(
................................................................................
   561    576   #define sqlite3_bind_pointer           sqlite3_api->bind_pointer
   562    577   #define sqlite3_result_pointer         sqlite3_api->result_pointer
   563    578   #define sqlite3_value_pointer          sqlite3_api->value_pointer
   564    579   /* Version 3.22.0 and later */
   565    580   #define sqlite3_vtab_nochange          sqlite3_api->vtab_nochange
   566    581   #define sqlite3_value_nochange         sqlite3_api->value_nochange
   567    582   #define sqlite3_vtab_collation         sqlite3_api->vtab_collation
          583  +/* Version 3.24.0 and later */
          584  +#define sqlite3_keyword_count          sqlite3_api->keyword_count
          585  +#define sqlite3_keyword_name           sqlite3_api->keyword_name
          586  +#define sqlite3_keyword_check          sqlite3_api->keyword_check
          587  +#define sqlite3_str_new                sqlite3_api->str_new
          588  +#define sqlite3_str_finish             sqlite3_api->str_finish
          589  +#define sqlite3_str_appendf            sqlite3_api->str_appendf
          590  +#define sqlite3_str_vappendf           sqlite3_api->str_vappendf
          591  +#define sqlite3_str_append             sqlite3_api->str_append
          592  +#define sqlite3_str_appendall          sqlite3_api->str_appendall
          593  +#define sqlite3_str_appendchar         sqlite3_api->str_appendchar
          594  +#define sqlite3_str_reset              sqlite3_api->str_reset
          595  +#define sqlite3_str_errcode            sqlite3_api->str_errcode
          596  +#define sqlite3_str_length             sqlite3_api->str_length
          597  +#define sqlite3_str_value              sqlite3_api->str_value
   568    598   #endif /* !defined(SQLITE_CORE) && !defined(SQLITE_OMIT_LOAD_EXTENSION) */
   569    599   
   570    600   #if !defined(SQLITE_CORE) && !defined(SQLITE_OMIT_LOAD_EXTENSION)
   571    601     /* This case when the file really is being compiled as a loadable 
   572    602     ** extension */
   573    603   # define SQLITE_EXTENSION_INIT1     const sqlite3_api_routines *sqlite3_api=0;
   574    604   # define SQLITE_EXTENSION_INIT2(v)  sqlite3_api=v;