소프트웨어

[sqlite3] Tutorial

개발자_이훈규 2016. 5. 19. 16:50

1. Intro

http://php.net/manual/kr/book.sqlite3.php

(php사이트에서.)


http://luzluna.tistory.com/1



2. Tutorial


1) install

ubuntu 14.04 : sudo apt-get install sqlite3 sqlite3-doc

npm :                npm install sqlite3                                 (https://www.npmjs.com/package/sqlite3)



2) print 'hello world'


3) 예제 실행해보기

    - 실행하고 나면 파일이 만들어진다. 

( 자세한 설명도 있다, http://www.w3resource.com/node.js/nodejs-sqlite.php )



3. 노트


- RowId가 Primary key역활을 하는데, integer type인 Primary key가 존재한다면 이것이 RowId를 대체한다.


- data serialize(데이터 직렬화)



4. 궁금한 것들


1) Json type을 sqlite3에 바로 넣을 수 있나?

sol) http://stackoverflow.com/questions/34019147/storing-json-file-to-sqlite-database-using-node  ->

    https://www.sitepoint.com/using-redis-node-js/


sol) Convert JSON to SQLite in Python - How to map json keys to database columns properly?


sol) https://www.infoq.com/news/2015/10/sqlite-39-released

-> 현재 sqlite 3.9버전에는 json에 대한 함수가 정의되어 있지만 아직 동작은 안되고 있다고 한다.

    ( https://www.sqlite.org/json1.html )



5. Reference

node-sqlite3 page in github : https://github.com/mapbox/node-sqlite3

(한국어) sqlite3을 자세히 설명한 블로그 : http://gywn.net/2013/08/let-me-intorduce-sqlite/