blob: dc62df9f03a41a3e8be048f35d8cc0bcfce04ca8 [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 * ODBC Utility Class
20 *
21 * @category Database
22 * @author Rick Ellis
23 * @link http://www.codeigniter.com/database/
24 */
admina5e812c2006-09-25 02:17:30 +000025class CI_DB_odbc_utility extends CI_DB_utility {
26
admin6ca6f942006-09-25 02:51:08 +000027
28 /**
29 * Create database
30 *
admin6cec6a52006-09-25 06:56:49 +000031 * @access private
admin6ca6f942006-09-25 02:51:08 +000032 * @param string the database name
33 * @return bool
34 */
admin6cec6a52006-09-25 06:56:49 +000035 function _create_database()
admin6ca6f942006-09-25 02:51:08 +000036 {
37 // ODBC has no "create database" command since it's
38 // designed to connect to an existing database
admin3dd978f2006-09-30 19:24:45 +000039 if ($this->db->db_debug)
admin72496372006-09-25 03:44:04 +000040 {
admin3dd978f2006-09-30 19:24:45 +000041 return $this->db->display_error('db_unsuported_feature');
admin72496372006-09-25 03:44:04 +000042 }
admin6ca6f942006-09-25 02:51:08 +000043 return FALSE;
44 }
45
46 // --------------------------------------------------------------------
47
48 /**
49 * Drop database
50 *
admin83b05a82006-09-25 21:06:46 +000051 * @access private
admin6ca6f942006-09-25 02:51:08 +000052 * @param string the database name
53 * @return bool
54 */
admin83b05a82006-09-25 21:06:46 +000055 function _drop_database($name)
admin6ca6f942006-09-25 02:51:08 +000056 {
57 // ODBC has no "drop database" command since it's
admin72496372006-09-25 03:44:04 +000058 // designed to connect to an existing database
admin3dd978f2006-09-30 19:24:45 +000059 if ($this->db->db_debug)
admin72496372006-09-25 03:44:04 +000060 {
admin3dd978f2006-09-30 19:24:45 +000061 return $this->db->display_error('db_unsuported_feature');
admin72496372006-09-25 03:44:04 +000062 }
63 return FALSE;
64 }
65
66 // --------------------------------------------------------------------
67
68 /**
adminb2a9cec2006-10-01 03:38:04 +000069 * List databases
70 *
71 * @access private
72 * @return bool
73 */
74 function _list_databases()
75 {
76 // Not sure if ODBC lets you list all databases...
77 if ($this->db->db_debug)
78 {
79 return $this->db->display_error('db_unsuported_feature');
80 }
81 return FALSE;
82 }
83
84 // --------------------------------------------------------------------
85
86 /**
admin4ceac2d2006-09-25 06:40:16 +000087 * Drop Table
88 *
admin83b05a82006-09-25 21:06:46 +000089 * @access private
admin4ceac2d2006-09-25 06:40:16 +000090 * @return bool
91 */
admin83b05a82006-09-25 21:06:46 +000092 function _drop_table($table)
admin4ceac2d2006-09-25 06:40:16 +000093 {
94 // Not a supported ODBC feature
admin3dd978f2006-09-30 19:24:45 +000095 if ($this->db->db_debug)
admin4ceac2d2006-09-25 06:40:16 +000096 {
admin3dd978f2006-09-30 19:24:45 +000097 return $this->db->display_error('db_unsuported_feature');
admin4ceac2d2006-09-25 06:40:16 +000098 }
99 return FALSE;
100 }
101
102 // --------------------------------------------------------------------
103
104 /**
adminab4f61b2006-09-25 22:12:32 +0000105 * Optimize table query
106 *
107 * Generates a platform-specific query so that a table can be optimized
108 *
109 * @access private
110 * @param string the table name
111 * @return object
112 */
113 function _optimize_table($table)
114 {
115 // Not a supported ODBC feature
admin3dd978f2006-09-30 19:24:45 +0000116 if ($this->db->db_debug)
adminab4f61b2006-09-25 22:12:32 +0000117 {
admin3dd978f2006-09-30 19:24:45 +0000118 return $this->db->display_error('db_unsuported_feature');
adminab4f61b2006-09-25 22:12:32 +0000119 }
120 return FALSE;
121 }
122
123 // --------------------------------------------------------------------
124
125 /**
126 * Repair table query
127 *
128 * Generates a platform-specific query so that a table can be repaired
129 *
130 * @access private
131 * @param string the table name
132 * @return object
133 */
134 function _repair_table($table)
135 {
136 // Not a supported ODBC feature
admin3dd978f2006-09-30 19:24:45 +0000137 if ($this->db->db_debug)
adminab4f61b2006-09-25 22:12:32 +0000138 {
admin3dd978f2006-09-30 19:24:45 +0000139 return $this->db->display_error('db_unsuported_feature');
adminab4f61b2006-09-25 22:12:32 +0000140 }
141 return FALSE;
142 }
admina5e812c2006-09-25 02:17:30 +0000143
admin3cad41e2006-10-02 03:21:46 +0000144 // --------------------------------------------------------------------
145
146 /**
147 * ODBC Export
148 *
149 * @access private
150 * @param array Preferences
151 * @return mixed
152 */
153 function _backup($params = array())
154 {
155 // Currently unsupported
156 return $this->db->display_error('db_unsuported_feature');
157 }
admina5e812c2006-09-25 02:17:30 +0000158
admin7b613c72006-09-24 18:05:17 +0000159}
160
161?>