upnpsharing/upnpsecurity/inc/server/upnpsecuritysqlclausedef.h
changeset 0 7f85d04be362
equal deleted inserted replaced
-1:000000000000 0:7f85d04be362
       
     1 /** @file
       
     2  * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
       
     3  * All rights reserved.
       
     4  * This component and the accompanying materials are made available
       
     5  * under the terms of "Eclipse Public License v1.0"
       
     6  * which accompanies  this distribution, and is available 
       
     7  * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8  *
       
     9  * Initial Contributors:
       
    10  * Nokia Corporation - initial contribution.
       
    11  *
       
    12  * Contributors:
       
    13  *
       
    14  *  Description : SQL clause definitions
       
    15  *
       
    16  */
       
    17 
       
    18 #ifndef __UPNPSECSQLCLAUSEDEF_H__
       
    19 #define __UPNPSECSQLCLAUSEDEF_H__
       
    20 
       
    21 // CONSTANTS
       
    22 
       
    23 ///////////////////////////////////////////////////////////////////
       
    24 // DROP CLAUSES
       
    25 ///////////////////////////////////////////////////////////////////
       
    26 _LIT8( KUpnpSecSqlDropAddressList, "DROP TABLE IF EXISTS AddressList;");
       
    27 _LIT8( KUpnpSecSqlDropFileList, "DROP TABLE IF EXISTS FileList;" );
       
    28 
       
    29 ///////////////////////////////////////////////////////////////////
       
    30 // CREATE CLAUSES FOR TABLES
       
    31 ///////////////////////////////////////////////////////////////////
       
    32 _LIT8( KUpnpSecSqlCreateAddressList, 
       
    33     "CREATE TABLE IF NOT EXISTS AddressList("
       
    34         "Ip                 INTEGER PRIMARY KEY);"
       
    35         );
       
    36 
       
    37 _LIT8( KUpnpSecSqlCreateFileList, 
       
    38     "CREATE TABLE IF NOT EXISTS FileList("
       
    39         "Filename          TEXT PRIMARY KEY);"
       
    40         );
       
    41 
       
    42 ///////////////////////////////////////////////////////////////////
       
    43 // INSERT STATEMENTS
       
    44 ///////////////////////////////////////////////////////////////////
       
    45 //
       
    46 // Inserting ip address into AddressList table
       
    47 _LIT8( KUpnpSecSqlInsertIpAddress,
       
    48     "INSERT INTO AddressList( " 
       
    49     "Ip ) "
       
    50     "VALUES( ? );"
       
    51     );
       
    52 // Inserting filename into FileList table
       
    53 _LIT8( KUpnpSecSqlInsertFile,
       
    54     "INSERT INTO FileList( " 
       
    55     "Filename ) "
       
    56     "VALUES( ? );"
       
    57     );
       
    58 
       
    59 ///////////////////////////////////////////////////////////////////
       
    60 // SELECT STATEMENTS
       
    61 ///////////////////////////////////////////////////////////////////
       
    62 //
       
    63 // Select all ip addresses from AddressList table
       
    64 _LIT8( KUpnpSecSqlSelectAllIpAddresses,
       
    65     "SELECT Ip FROM AddressList "
       
    66     );
       
    67 
       
    68 // Select all filenames from FileList table
       
    69 _LIT8( KUpnpSecSqlSelectAllFiles, "SELECT Filename FROM FileList " 
       
    70     );
       
    71 
       
    72 _LIT8( KUpnpSecSqlValidateTableExistence, "SELECT count(*) FROM AddressList, FileList;" );
       
    73 
       
    74 // ---------------------------------------------------------------------------
       
    75 // DELETE STATEMENTS
       
    76 // ---------------------------------------------------------------------------
       
    77 //
       
    78 _LIT8( KUpnpSecSqlDeleteIpAddress, 
       
    79     "DELETE FROM AddressList "
       
    80     "WHERE Ip = ? ;"
       
    81     );
       
    82 _LIT8( KUpnpSecSqlDeleteAllIpAddresses, 
       
    83     "DELETE FROM AddressList;"
       
    84     );
       
    85     
       
    86 _LIT8( KUpnpSecSqlDeleteFile, 
       
    87     "DELETE FROM FileList "
       
    88     "WHERE Filename = ? ;"
       
    89     );
       
    90 _LIT8( KUpnpSecSqlDeleteAllFiles, 
       
    91     "DELETE FROM FileList;"
       
    92     );
       
    93 
       
    94 ///////////////////////////////////////////////////////////////////
       
    95 // MISC DEFINITIONS
       
    96 ///////////////////////////////////////////////////////////////////
       
    97 //
       
    98 _LIT16( KUpnpSecSqlIp, "Ip" );
       
    99 _LIT16( KUpnpSecSqlFilename, "Filename" );
       
   100 
       
   101 #endif // __UPNPSECSQLCLAUSEDEF_H__
       
   102 // End of File