037. rails, postgres, angular, bootstrap - cwy007/tips-and-skills GitHub Wiki
- postgreSQL 开源数据库
- mySQL 开源数据库
- $
createuser --createdb --login -P shine
You’ll be prompted for a password, so enter shine twice, as requested. --createdb tells Postgres that our user should be able to create databases (needed in a later step). The --login switch will allow our user to log in to the database and -P means we want to set our new user’s password right now (which is why you were prompted for a password)
-
$ psql postgres
-
NPM to manage Shine’s dependency on Bootstrap’s code, and Webpack to serve it up.
-
a system like Bundler, Bundler only manages RubyGems
-
the package manage- ment system for JavaScript (and the rest of the front-end ecosystem): NPM.
-
NPM is part of Node.js and is the Node equivalent of Bundler
-
Gemfile, NPM uses a file named package.json
-
Webpack vs Sprockets 驱动assets
-
Webpack is an asset pipeline
-
authentication 验证 devise
-
在终端查看数据库 Postgres
$ bundle exec rails dbconsole
postgres> \x on
Expanded display is on.
postgres> select * from users;
- sensible 使用的
- scheme 方案
- initializer 初始化器
- Active Record provides the method
update_attribute
, which skips validations - check constraints 检查约束
- vulnerabilities 漏洞, 弱点
- powerful features 强大的功能
- circumvent 规避,绕过
- introduce 引入
- weigh 权衡
- null constraint, not null
- Postgres Data Definition Language (DDL)
- execute method to execute arbitrary SQL:
Product.connection.execute("UPDATE products SET price = 'free' WHERE 1=1")
- the migrations DSL
- dump 转存
- security or user experience