this is embedded db
root
- db
- testDB
- database.js
- table.js
- handler.js
- input.js
you need change 'dbroot' value to your 'project root path\db'
example
const root = 'C:\Users\[your user name]\[your path]\db'
cd testDB
node input and input below command
-
db create [db name] => new folder
-
db use [db name] => path : db folder
-
db drop [db name] => rm folder
-
db show => print db list
-
tb create [table name] (...) => new file in db folder
tb create(column name, type, [primary key = no, auto_increment=no, not null = no, default = null])
-
tb insert into [table name] (col1, [col2, col3, ...]) values(vla1, [val2, val3, ...])
-
tb select [column name] from [table name] where (col name = value)
회원가입 : 이메일 주소 있는지, select email from user where email=(check_email)
> 로그인 : select id, pw from user where id=(check_id) and pw=(check_pw)
-
tb update [table name] set [feild name1=data1, ...] where (feild name = value)
-
tb delete [table name] => rm file
-
tb show => print table list
-
tb desc [table name] => desc table