SQLite3 on windows
rails2.0ããããã©ã«ãã®ãã¼ã¿ãã¼ã¹ãSQLiteã«å¤ãã£ãã®ã§ããããã ãã§ã触ã£ã¦ãããã¨æããã¤ã³ã¹ãã¼ã«ãããã¼ãã«ä½æã¾ã§ãã£ã¦ã¿ã¾ãããwindowsçã§è©¦ããã®ã§macçã¯å¥ã¨ã³ããªã¼ã§ã
触ãåã®SQLiteã®ã¤ã¡ã¼ã¸
- 軽édbms=ãã¾ã使ããªãdbms
- ãã¤ããªãªãè¤éãªã¤ã³ã¹ãã¼ã«ã¯ãªã
- SQL92ã«æºæ ãã¦ããã©ãæªå®è£ ãä¸æ¯
- SQL2000ã¯æªå¯¾å¿
ã¯ãããªæãã
ã§ã¯å®éã«ã¤ã³ã¹ãã¼ã«ãã
1.SQLiteã®ã¤ã³ã¹ãã¼ã«
SQLiteããWindows Binaryããã¦ã³ãã¼ãã
ã¤ã³ã¹ãã¼ã«ã¯è§£åããã ããPATHã®éã£ã¦ããæã¸ç½®ãã°ã¤ã³ã¹ãã¼ã«å®äºã
2.ãã¼ã¿ãã¼ã¹ã®ä½æ
SQLiteã¯ç¹ã«ãµã¼ãã¹ã¨ããããããã§ã¯ãªãããã¡ã¤ã«ãã¼ã¹(Accessã¨ãdb4oã¨ä¸ç·ãªæã)ãªã®ã§ãã®ã¾ã¾DBãã³ãã³ãã§æå®ããã¨ä½æããã¾ãã
sqlite3 example.db
3.ãã¼ãã«ã®ä½æ
SQL92ã«æºæ ãªã®ã§æ®éã«DDLãçºè¡ããã°OK
create table example(
id int primary key,
name varchar(255)
);
ããã§ä½æããã¾ãã
ãã¼ãã«ã®ã«ã©ã ãè¦ã
.schema example
ããããªããåãä»ããªããschemaã®æå³ã¯ç¢ºãã«ãã(XMLã®schemaã¨åã)ãªãã ãã©ã»ã»ã»
ãã¨ã¯å¤§ä½ä¸ç·ã§ãããã
ã§ãå°è±¡ã
- dbã¸ã®æ¥ç¶ã§ãã¡ã¤ã«æå®ããã¨è¨ããã¨ã¯æ¥ç¶å®ç¾©ãé¢åèããã
- è¤æ°äººã§ã¯ã©ãæ¥ç¶ããã®ãã(accessã¿ããã«Lockãããï¼)
- ã¤ã³ã¹ãã¼ã«ã¯ç°¡åãã¡ãã£ã¨ããå 容ãdbã§è¦ããã»ç®¡çãããå ´åã«ã¯ããï¼=>ã ãã軽éï¼
- ããã¥ã¡ã³ããè±èªããã¿ããããªãã
- importãexportã¯ç°¡åãã
ãããªæã«æ¸ãã¦ãã£ã
SQLiteã®ç¹å¾´ããããã¨æ¬¡ã®ããã«ãªãã¾ãã
- SQL92ããµãã¼ã
- ãã¼ã¿ãã¼ã¹ã¯ï¼åä¸ã®ãã¡ã¤ã«ã«æ ¼ç´
- ãã©ã³ã¶ã¯ã·ã§ã³æ©è½ããµãã¼ããï¼ãã¼ã¿ã®å®å ¨æ§ãä¿è·
- ãã¼ã¿ãã¼ã¹ã»ãã¡ã¤ã«ã®æ§æã¯ãã¤ããªã¼ãã¼ã«ä¾åããªãããï¼ãã¡ã¤ã«ã»ã³ãã¼ã§ãã·ã³ã移åå¯è½
- æ¶è²»ã¡ã¢ãªã¼ãå°ãªã
- ã¦ã¼ã¶ã¼ã¨ããæ¦å¿µã¯ãªã
- 対å¿ãããã¼ã¿åã¯INTEGERåï¼REALåï¼TEXTåï¼BLOBå
- ãããªãã¯ãã¡ã¤ã³ã¨ãã¦æä¾ããã¦ããï¼ç¡åã§ããã ãã§ãªãï¼ã½ã¼ã¹ã³ã¼ãã®æ¹å¤ã第ä¸è ã¸ã®åé å¸ãèªç±ã«è¡ããã¨ãå¯è½
- 対å¿ããæåã³ã¼ãã¯UTF8ï¼UCS2ï¼UTF16ï¼