コンピューターのことなどを綴ったメモ (旧:目から鱗 w/SQLite)
| Jeans & Development | 電子ブロック工房 | 三日坊主 | フロントページ |
MySQL emulator using SQLite [General]
2006年3月12日
mysqli [Nucleus/SQLite]
2006年3月11日
将来的にNucleusでもこれらの機能を使うことになるのだと思われる。ただ、世の中で出回っているほとんど全てのPHP/MySQLでmysqliが標準装備になってからのことだろうと思う。そのころには、SQLiteラッパーでも対応できるようになる…かな?
(追記)admunさんに教わって見てみたコードは、既存のmysql_xxx()関数をラップしてmysqli_xxx()として提供するものだった。今のSQLiteプロジェクトと同じようなもの。ただし、同じMySQL内のラッピングだから、query構文の置換などは一切必要ない模様。
SQLite-6 [Nucleus/SQLite]
2006年3月10日
これによると、『¥』を用いたエスケープ以外に、
‘'’ で囲んだ文字列内で ‘'’ を使用する場合、文字列内の ‘'’ は '''' と記述することができる。
‘"’ で囲んだ文字列内で ‘"’ を使用する場合、文字列内の ‘"’ は '""' と記述することができる。
ということらしい。このあたりもSQLite用のラッパーで反映させておかないと、上手くいかないケースもあるかも知れない。
(対応済み)
SQLite-5 [Nucleus/SQLite]
2006年3月9日
SHOW FIELDS FROM (→完了)
SHOW KEYS FROM (→完了)
SHOW TABLES LIKE (→完了)
DROP TABLE IF EXISTS (→完了)
これらが、データベースのバックアップ時に必要。
(追記)
DROP TABLE IF EXISTS は解決。結果として、データベースの取り込みはできるようになった模様。書き出しには、SHOW FIELDS FROM と SHOW KEYS FROM が必要(→完了)。
VBScript用、ereg_replace, eregi_replace [プログラミング]
2006年3月8日
Nucleus プラグインのテンプレート [Nucleus]
2006年3月2日
<?php
class NP_Template extends NucleusPlugin {
function getName() { return preg_replace('/^.*[\/\\\\]NP_([^\/\\\\]*)\.php$/','$1',__FILE__); }
function getMinNucleusVersion() { return 220; }
function getAuthor() { return 'Katsumi'; }
function getVersion() { return '0.1'; }
function getURL() {return 'http://hp.vector.co.jp/authors/VA016157/';}
function getDescription() { return $this->getName().' plugin'; }
function supportsFeature($what) { return (int)($what=='SqlTablePrefix'); }
function getEventList() { return array(); }
//function getTableList() { return $this->sql_query('list'); }
function install() {/* $this->sql_query('create','(id int(11) not null auto_increment)'); */}
function unInstall() {/* $this->sql_query('drop'); */}
//function init() {}
//function doSkinVar($skinType,$type) {}
//function doTemplateVar(&$item,$type) {}
//function doAction($type){}
/* function sql_query($mode='name',$p1=''){
$tablename[0]=sql_table(strtolower('plugin_'.substr(get_class($this),3)));
switch($mode){
case 'create': return sql_query('CREATE TABLE IF NOT EXISTS '.$tablename[0].' '.$p1);
case 'drop': return sql_query('DROP TABLE IF EXISTS '.$tablename[0]);
case 'list': return $tablename;
case 'name': return $tablename[0];
default: return sql_query($mode.' '.$tablename[0].' '.$p1);
}
} */
function getOption($name){ return $this->_getOption('global', 0, $name); }//required for Nucleus 3.24
}
?>