dbd/postgresql/connection.c

changeset 14
98192b7d4e89
parent 13
10c8c6f0da14
child 22
fd78e9cdc6e9
equal deleted inserted replaced
13:10c8c6f0da14 14:98192b7d4e89
73 password = luaL_checkstring(L, 3); 73 password = luaL_checkstring(L, 3);
74 case 2: 74 case 2:
75 if (lua_isnil(L, 2) == 0) 75 if (lua_isnil(L, 2) == 0)
76 user = luaL_checkstring(L, 2); 76 user = luaL_checkstring(L, 2);
77 case 1: 77 case 1:
78 if (lua_isnil(L, 1) == 0) 78 /*
79 db = luaL_checkstring(L, 1); 79 * db is the only mandatory parameter
80 */
81 db = luaL_checkstring(L, 1);
80 } 82 }
81 83
82 conn = (connection_t *)lua_newuserdata(L, sizeof(connection_t)); 84 conn = (connection_t *)lua_newuserdata(L, sizeof(connection_t));
83 85
84 conn->postgresql = PQsetdbLogin(host, port, options, tty, db, user, password); 86 conn->postgresql = PQsetdbLogin(host, port, options, tty, db, user, password);

mercurial