dbd/sqlite3/connection.c

changeset 14
98192b7d4e89
parent 13
10c8c6f0da14
child 22
fd78e9cdc6e9
equal deleted inserted replaced
13:10c8c6f0da14 14:98192b7d4e89
33 connection_t *conn = NULL; 33 connection_t *conn = NULL;
34 34
35 /* db */ 35 /* db */
36 switch(n) { 36 switch(n) {
37 default: 37 default:
38 if (lua_isnil(L, 1) == 0) 38 /*
39 db = luaL_checkstring(L, 1); 39 * db is the only mandatory parameter
40 */
41 db = luaL_checkstring(L, 1);
40 } 42 }
41 43
42 conn = (connection_t *)lua_newuserdata(L, sizeof(connection_t)); 44 conn = (connection_t *)lua_newuserdata(L, sizeof(connection_t));
43 45
44 if (sqlite3_open(db, &conn->sqlite) != SQLITE_OK) { 46 if (sqlite3_open(db, &conn->sqlite) != SQLITE_OK) {

mercurial