os/persistentdata/persistentstorage/sql/SRC/Server/SqlSrvStatementUtil.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
sl@0
     1
// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     2
// All rights reserved.
sl@0
     3
// This component and the accompanying materials are made available
sl@0
     4
// under the terms of "Eclipse Public License v1.0"
sl@0
     5
// which accompanies this distribution, and is available
sl@0
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     7
//
sl@0
     8
// Initial Contributors:
sl@0
     9
// Nokia Corporation - initial contribution.
sl@0
    10
//
sl@0
    11
// Contributors:
sl@0
    12
//
sl@0
    13
// Description:
sl@0
    14
// Global sql statement related functions
sl@0
    15
// 
sl@0
    16
//
sl@0
    17
sl@0
    18
#ifndef __SQLSRVSTATEMENTUTIL_H__
sl@0
    19
#define __SQLSRVSTATEMENTUTIL_H__
sl@0
    20
sl@0
    21
#include <e32std.h>
sl@0
    22
sl@0
    23
//This header file contains useful utility function declarations.
sl@0
    24
//These functions are used for accessging directly the SQLITE interface functions.
sl@0
    25
sl@0
    26
//Forward declarations
sl@0
    27
struct sqlite3;
sl@0
    28
struct sqlite3_stmt;
sl@0
    29
struct sqlite3_context;
sl@0
    30
struct Mem;
sl@0
    31
typedef struct Mem sqlite3_value;
sl@0
    32
sl@0
    33
TInt CreateDbHandle16(const TDesC& aFileNameZ, sqlite3*& aDbHandle);
sl@0
    34
TInt CreateDbHandle8(const TDesC8& aFileNameZ, sqlite3*& aDbHandle);
sl@0
    35
inline void CloseDbHandle(sqlite3* aDbHandle);
sl@0
    36
inline void CloseDbCleanup(void* aDbHandle);
sl@0
    37
TPtrC GetFirstSqlStmt(TPtr& aString);
sl@0
    38
TInt DbExecStmt16(sqlite3 *aDbHandle, TDes16& aSqlStmt);
sl@0
    39
TInt DbExecStmt8(sqlite3 *aDbHandle, const TDesC8& aSqlStmt);
sl@0
    40
sl@0
    41
sqlite3_stmt* StmtPrepare16L(sqlite3* aDbHandle, const TDesC16& aSqlStmt);
sl@0
    42
TInt StmtPrepare8(sqlite3* aDbHandle, const TDesC8& aSqlStmt, sqlite3_stmt*& aStmtHandle);
sl@0
    43
sqlite3_stmt* StmtPrepare8L(sqlite3* aDbHandle, const TDesC8& aSqlStmt);
sl@0
    44
TInt FinalizeStmtHandle(sqlite3_stmt* aStmtHandle);
sl@0
    45
TInt StmtExec(sqlite3_stmt* aStmtHandle);
sl@0
    46
TInt StmtNext(sqlite3_stmt* aStmtHandle);
sl@0
    47
TInt StmtReset(sqlite3_stmt* aStmtHandle);
sl@0
    48
sl@0
    49
TInt DbPageCount(sqlite3* aDbHandle, const TDesC& aDbName, TInt& aPageCount);
sl@0
    50
TInt DbPageSize(sqlite3* aDbHandle, const TDesC& aDbName, TInt& aPageSize);
sl@0
    51
TInt DbCacheSize(sqlite3* aDbHandle, const TDesC& aDbName, TInt& aCacheSize);
sl@0
    52
TInt DbEncoding(sqlite3* aDbHandle, const TDesC& aDbName, TDes8& aEncoding);
sl@0
    53
TInt DbFreePageCount(sqlite3* aDbHandle, const TDesC& aDbName, TInt& aPageCount);
sl@0
    54
TInt DbVacuumMode(sqlite3* aDbHandle, const TDesC& aDbName, TInt& aVacuumMode);
sl@0
    55
TInt DbCompact(sqlite3* aDbHandle, const TDesC& aDbName, TInt aPageCount, TInt& aProcessedPageCount, TInt aMaxTime = 0);
sl@0
    56
sl@0
    57
#include "SqlSrvStatementUtil.inl"
sl@0
    58
sl@0
    59
#endif//__SQLSRVSTATEMENTUTIL_H__