Permalink
Browse files

prepare for moving sqlite to a dedicated plugin

  • Loading branch information...
1 parent 4d9a88e commit 31fbb6e4f5ca4328fdc8cdd36c7fd927bc1753f9 @unbit committed Apr 5, 2013
Showing with 0 additions and 94 deletions.
  1. +0 −1 buildconf/base.ini
  2. +0 −1 buildconf/ppa.ini
  3. +0 −1 buildconf/unbit.ini
  4. +0 −57 core/sqlite3.c
  5. +0 −11 core/uwsgi.c
  6. +0 −8 uwsgi.h
  7. +0 −15 uwsgiconfig.py
View
@@ -2,7 +2,6 @@
xml = auto
yaml = true
json = auto
-sqlite3 = auto
zeromq = auto
ssl = auto
ldap = auto
View
@@ -2,7 +2,6 @@
xml = true
yaml = true
json = true
-sqlite3 = true
zeromq = true
ssl = true
ldap = true
View
@@ -2,7 +2,6 @@
xml = true
yaml = true
json = false
-sqlite3 = false
zeromq = false
ssl = true
ldap = false
View
@@ -1,57 +0,0 @@
-#ifdef UWSGI_SQLITE3
-
-#include "uwsgi.h"
-#include <sqlite3.h>
-
-extern struct uwsgi_server uwsgi;
-
-static int uwsgi_sqlite3_config_callback(void *magic_table, int field_count, char **fields, char **col) {
- // make a copy of the string
- if (field_count >= 2) {
- size_t value_len = strlen(fields[1]) + 1;
- char *value = magic_sub(fields[1], value_len, &value_len, (char **) magic_table);
- add_exported_option(uwsgi_strncopy(fields[0], strlen(fields[0])), value, 0);
- }
-
- return 0;
-}
-
-
-void uwsgi_sqlite3_config(char *file, char *magic_table[]) {
-
- sqlite3 *db;
- char *err = NULL;
- char *query = "SELECT * FROM uwsgi";
-
- char *colon = uwsgi_get_last_char(file, ':');
-
- if (colon) {
- colon[0] = 0;
- if (colon[1] != 0) {
- query = colon + 1;
- }
- }
-
- uwsgi_log("[uWSGI] getting sqlite3 configuration from %s\n", file);
-
-#ifdef sqlite3_open_v2
- if (sqlite3_open_v2(file, &db, SQLITE_OPEN_READONLY, NULL)) {
-#else
- if (sqlite3_open(file, &db)) {
-#endif
- uwsgi_log("unable to open sqlite3 db: %s\n", sqlite3_errmsg(db));
- sqlite3_close(db);
- exit(1);
- }
-
- if (sqlite3_exec(db, query, uwsgi_sqlite3_config_callback, (void *) magic_table, &err)) {
- uwsgi_log("sqlite3 error: %s\n", err);
- sqlite3_close(db);
- exit(1);
- }
-
- sqlite3_close(db);
-
-}
-
-#endif
View
@@ -294,10 +294,6 @@ static struct uwsgi_option uwsgi_base_options[] = {
{"json", required_argument, 'j', "load config from json file", uwsgi_opt_load_json, NULL, UWSGI_OPT_IMMEDIATE},
{"js", required_argument, 'j', "load config from json file", uwsgi_opt_load_json, NULL, UWSGI_OPT_IMMEDIATE},
#endif
-#ifdef UWSGI_SQLITE3
- {"sqlite3", required_argument, 0, "load config from sqlite3 db", uwsgi_opt_load_sqlite3, NULL, UWSGI_OPT_IMMEDIATE},
- {"sqlite", required_argument, 0, "load config from sqlite3 db", uwsgi_opt_load_sqlite3, NULL, UWSGI_OPT_IMMEDIATE},
-#endif
#ifdef UWSGI_ZEROMQ
{"zeromq", required_argument, 0, "create a zeromq pub/sub pair", uwsgi_opt_add_lazy_socket, "zmq", 0},
{"zmq", required_argument, 0, "create a zeromq pub/sub pair", uwsgi_opt_add_lazy_socket, "zmq", 0},
@@ -3883,13 +3879,6 @@ void uwsgi_opt_load_yml(char *opt, char *filename, void *none) {
}
#endif
-#ifdef UWSGI_SQLITE3
-void uwsgi_opt_load_sqlite3(char *opt, char *filename, void *none) {
- config_magic_table_fill(filename, uwsgi.magic_table);
- uwsgi_sqlite3_config(filename, uwsgi.magic_table);
-}
-#endif
-
#ifdef UWSGI_JSON
void uwsgi_opt_load_json(char *opt, char *filename, void *none) {
config_magic_table_fill(filename, uwsgi.magic_table);
View
@@ -2664,11 +2664,6 @@ void uwsgi_ini_config(char *, char *[]);
void uwsgi_json_config(char *, char *[]);
#endif
-#ifdef UWSGI_SQLITE3
- void uwsgi_sqlite3_config(char *, char *[]);
-#endif
-
-
#ifdef UWSGI_LDAP
void uwsgi_opt_ldap_dump(char *, char *, void *);
void uwsgi_opt_ldap_dump_ldif(char *, char *, void *);
@@ -3242,9 +3237,6 @@ void uwsgi_opt_load_xml(char *, char *, void *);
#ifdef UWSGI_YAML
void uwsgi_opt_load_yml(char *, char *, void *);
#endif
-#ifdef UWSGI_SQLITE3
-void uwsgi_opt_load_sqlite3(char *, char *, void *);
-#endif
#ifdef UWSGI_JSON
void uwsgi_opt_load_json(char *, char *, void *);
#endif
View
@@ -70,7 +70,6 @@
report['ssl'] = False
report['zeromq'] = False
report['xml'] = False
-report['sqlite3'] = False
report['debug'] = False
report['plugin_dir'] = False
report['zlib'] = False
@@ -1052,20 +1051,6 @@ def get_gcll(self):
self.gcc_list.append('core/xmlconf')
report['xml'] = 'expat'
- if self.get('sqlite3'):
- if self.get('sqlite3') == 'auto':
- if self.has_include('sqlite3.h'):
- self.cflags.append("-DUWSGI_SQLITE3")
- self.libs.append('-lsqlite3')
- self.gcc_list.append('core/sqlite3')
- report['sqlite3'] = True
- else:
- self.cflags.append("-DUWSGI_SQLITE3")
- self.libs.append('-lsqlite3')
- self.gcc_list.append('core/sqlite3')
- report['sqlite3'] = True
-
-
if self.get('plugin_dir'):
self.cflags.append('-DUWSGI_PLUGIN_DIR=\\"%s\\"' % self.get('plugin_dir'))
report['plugin_dir'] = self.get('plugin_dir')

0 comments on commit 31fbb6e

Please sign in to comment.