blob: 2b99df9073e59122317a96a248f6cb7b1c1b54cb [file] [log] [blame]
admin7b613c72006-09-24 18:05:17 +00001<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
2/**
3 * Code Igniter
4 *
5 * An open source application development framework for PHP 4.3.2 or newer
6 *
7 * @package CodeIgniter
8 * @author Rick Ellis
9 * @copyright Copyright (c) 2006, pMachine, Inc.
10 * @license http://www.codeignitor.com/user_guide/license.html
11 * @link http://www.codeigniter.com
12 * @since Version 1.0
13 * @filesource
14 */
15
16// ------------------------------------------------------------------------
17
18/**
19 * SQLite Utility Class
20 *
21 * @category Database
22 * @author Rick Ellis
23 * @link http://www.codeigniter.com/user_guide/database/
24 */
admina5e812c2006-09-25 02:17:30 +000025class CI_DB_sqlite_utility extends CI_DB_utility {
26
admin7b613c72006-09-24 18:05:17 +000027 /**
admina5e812c2006-09-25 02:17:30 +000028 * Version number query string
admin7b613c72006-09-24 18:05:17 +000029 *
30 * @access public
admina5e812c2006-09-25 02:17:30 +000031 * @return string
admin7b613c72006-09-24 18:05:17 +000032 */
admina5e812c2006-09-25 02:17:30 +000033 function _version()
admin7b613c72006-09-24 18:05:17 +000034 {
admina5e812c2006-09-25 02:17:30 +000035 return sqlite_libversion();
36 }
37
38 // --------------------------------------------------------------------
39
40 /**
41 * Show table query
42 *
43 * Generates a platform-specific query string so that the table names can be fetched
44 *
45 * @access public
46 * @return string
47 */
48 function _show_tables()
49 {
50 return "SELECT name from sqlite_master WHERE type='table'";
admin7b613c72006-09-24 18:05:17 +000051 }
52
53 // --------------------------------------------------------------------
54
admina5e812c2006-09-25 02:17:30 +000055 /**
56 * Show columnn query
57 *
58 * Generates a platform-specific query string so that the column names can be fetched
59 *
60 * @access public
61 * @param string the table name
62 * @return string
63 */
64 function _show_columns($table = '')
65 {
66 // Not supported
67 return FALSE;
68 }
69
70 // --------------------------------------------------------------------
71
72 /**
73 * Field data query
74 *
75 * Generates a platform-specific query so that the column data can be retrieved
76 *
77 * @access public
78 * @param string the table name
79 * @return object
80 */
81 function _field_data($table)
82 {
83 $sql = "SELECT * FROM ".$this->db->_escape_table($table)." LIMIT 1";
84 $query = $this->db->query($sql);
85 return $query->field_data();
86 }
87
88
89
admin7b613c72006-09-24 18:05:17 +000090}
91
92?>