Changeset View
Changeset View
Standalone View
Standalone View
src/KDbConnection.cpp
Show First 20 Lines • Show All 1958 Lines • ▼ Show 20 Line(s) | 1958 | { | |||
---|---|---|---|---|---|
1959 | return executeVoidSQL(KDbEscapedString("ROLLBACK")); | 1959 | return executeVoidSQL(KDbEscapedString("ROLLBACK")); | ||
1960 | } | 1960 | } | ||
1961 | 1961 | | |||
1962 | bool KDbConnection::drv_setAutoCommit(bool /*on*/) | 1962 | bool KDbConnection::drv_setAutoCommit(bool /*on*/) | ||
1963 | { | 1963 | { | ||
1964 | return true; | 1964 | return true; | ||
1965 | } | 1965 | } | ||
1966 | 1966 | | |||
1967 | KDbCursor* KDbConnection::executeQuery(const KDbEscapedString& sql, int cursor_options) | 1967 | KDbCursor* KDbConnection::executeQuery(const KDbEscapedString& sql, KDbCursor::Options options) | ||
1968 | { | 1968 | { | ||
1969 | if (sql.isEmpty()) | 1969 | if (sql.isEmpty()) | ||
1970 | return 0; | 1970 | return 0; | ||
1971 | KDbCursor *c = prepareQuery(sql, cursor_options); | 1971 | KDbCursor *c = prepareQuery(sql, options); | ||
1972 | if (!c) | 1972 | if (!c) | ||
1973 | return 0; | 1973 | return 0; | ||
1974 | if (!c->open()) {//err - kill that | 1974 | if (!c->open()) {//err - kill that | ||
1975 | m_result = c->result(); | 1975 | m_result = c->result(); | ||
1976 | CursorDeleter deleter(c); | 1976 | CursorDeleter deleter(c); | ||
1977 | return 0; | 1977 | return 0; | ||
1978 | } | 1978 | } | ||
1979 | return c; | 1979 | return c; | ||
1980 | } | 1980 | } | ||
1981 | 1981 | | |||
1982 | KDbCursor* KDbConnection::executeQuery(KDbQuerySchema* query, const QList<QVariant>& params, | 1982 | KDbCursor* KDbConnection::executeQuery(KDbQuerySchema* query, const QList<QVariant>& params, | ||
1983 | int cursor_options) | 1983 | KDbCursor::Options options) | ||
1984 | { | 1984 | { | ||
1985 | KDbCursor *c = prepareQuery(query, params, cursor_options); | 1985 | KDbCursor *c = prepareQuery(query, params, options); | ||
1986 | if (!c) | 1986 | if (!c) | ||
1987 | return 0; | 1987 | return 0; | ||
1988 | if (!c->open()) {//err - kill that | 1988 | if (!c->open()) {//err - kill that | ||
1989 | m_result = c->result(); | 1989 | m_result = c->result(); | ||
1990 | CursorDeleter deleter(c); | 1990 | CursorDeleter deleter(c); | ||
1991 | return 0; | 1991 | return 0; | ||
1992 | } | 1992 | } | ||
1993 | return c; | 1993 | return c; | ||
1994 | } | 1994 | } | ||
1995 | 1995 | | |||
1996 | KDbCursor* KDbConnection::executeQuery(KDbQuerySchema* query, int cursor_options) | 1996 | KDbCursor* KDbConnection::executeQuery(KDbQuerySchema* query, KDbCursor::Options options) | ||
1997 | { | 1997 | { | ||
1998 | return executeQuery(query, QList<QVariant>(), cursor_options); | 1998 | return executeQuery(query, QList<QVariant>(), options); | ||
1999 | } | 1999 | } | ||
2000 | 2000 | | |||
2001 | KDbCursor* KDbConnection::executeQuery(KDbTableSchema* table, int cursor_options) | 2001 | KDbCursor* KDbConnection::executeQuery(KDbTableSchema* table, KDbCursor::Options options) | ||
2002 | { | 2002 | { | ||
2003 | return executeQuery(table->query(), cursor_options); | 2003 | return executeQuery(table->query(), options); | ||
2004 | } | 2004 | } | ||
2005 | 2005 | | |||
2006 | KDbCursor* KDbConnection::prepareQuery(KDbTableSchema* table, int cursor_options) | 2006 | KDbCursor* KDbConnection::prepareQuery(KDbTableSchema* table, KDbCursor::Options options) | ||
2007 | { | 2007 | { | ||
2008 | return prepareQuery(table->query(), cursor_options); | 2008 | return prepareQuery(table->query(), options); | ||
2009 | } | 2009 | } | ||
2010 | 2010 | | |||
2011 | KDbCursor* KDbConnection::prepareQuery(KDbQuerySchema* query, const QList<QVariant>& params, | 2011 | KDbCursor* KDbConnection::prepareQuery(KDbQuerySchema* query, const QList<QVariant>& params, | ||
2012 | int cursor_options) | 2012 | KDbCursor::Options options) | ||
2013 | { | 2013 | { | ||
2014 | KDbCursor* cursor = prepareQuery(query, cursor_options); | 2014 | KDbCursor* cursor = prepareQuery(query, options); | ||
2015 | if (cursor) | 2015 | if (cursor) | ||
2016 | cursor->setQueryParameters(params); | 2016 | cursor->setQueryParameters(params); | ||
2017 | return cursor; | 2017 | return cursor; | ||
2018 | } | 2018 | } | ||
2019 | 2019 | | |||
2020 | bool KDbConnection::deleteCursor(KDbCursor *cursor) | 2020 | bool KDbConnection::deleteCursor(KDbCursor *cursor) | ||
2021 | { | 2021 | { | ||
2022 | if (!cursor) | 2022 | if (!cursor) | ||
▲ Show 20 Lines • Show All 1403 Lines • Show Last 20 Lines |