+++ /dev/null
-<html>\r
-<head>\r
- <title>The source code</title>\r
- <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />\r
- <script type="text/javascript" src="../resources/prettify/prettify.js"></script>\r
-</head>\r
-<body onload="prettyPrint();">\r
- <pre class="prettyprint lang-js">// Asbtract base class for Connection classes\r
-Ext.sql.Connection = function(config){\r
- Ext.apply(this, config);\r
- Ext.sql.Connection.superclass.constructor.call(this);\r
-\r
- this.addEvents({\r
- open : true,\r
- close: true\r
- });\r
-};\r
-\r
-Ext.extend(Ext.sql.Connection, Ext.util.Observable, {\r
- maxResults: 10000,\r
- openState : false,\r
-\r
- // abstract methods\r
- open : function(file){\r
- },\r
-\r
- close : function(){\r
- },\r
-\r
- exec : function(sql){\r
- },\r
-\r
- execBy : function(sql, args){\r
- },\r
-\r
- query : function(sql){\r
- },\r
-\r
- queryBy : function(sql, args){\r
- },\r
-\r
- // protected/inherited method\r
- isOpen : function(){\r
- return this.openState;\r
- },\r
-\r
- getTable : function(name, keyName){\r
- return new Ext.sql.Table(this, name, keyName);\r
- },\r
-\r
- createTable : function(o){\r
- var tableName = o.name;\r
- var keyName = o.key;\r
- var fs = o.fields;\r
- if(!Ext.isArray(fs)){ // Ext fields collection\r
- fs = fs.items;\r
- }\r
- var buf = [];\r
- for(var i = 0, len = fs.length; i < len; i++){\r
- var f = fs[i], s = f.name;\r
- switch(f.type){\r
- case "int":\r
- case "bool":\r
- case "boolean":\r
- s += ' INTEGER';\r
- break;\r
- case "float":\r
- s += ' REAL';\r
- break;\r
- default:\r
- s += ' TEXT';\r
- }\r
- if(f.allowNull === false || f.name == keyName){\r
- s += ' NOT NULL';\r
- }\r
- if(f.name == keyName){\r
- s += ' PRIMARY KEY';\r
- }\r
- if(f.unique === true){\r
- s += ' UNIQUE';\r
- }\r
-\r
- buf[buf.length] = s;\r
- }\r
- var sql = ['CREATE TABLE IF NOT EXISTS ', tableName, ' (', buf.join(','), ')'].join('');\r
- this.exec(sql);\r
- }\r
-});\r
-\r
-\r
-Ext.sql.Connection.getInstance = function(db, config){\r
- if(Ext.isAir){ // air\r
- return new Ext.sql.AirConnection(config);\r
- } else { // gears\r
- return new Ext.sql.GearsConnection(config);\r
- }\r
-};</pre> \r
-</body>\r
-</html>
\ No newline at end of file