Enviar pesquisa
Carregar
Sails.js Model / ORM introduce
•
26 gostaram
•
72,306 visualizações
謝 宗穎
Seguir
Sails.js Model / ORM introduce
Leia menos
Leia mais
Tecnologia
Negócios
Denunciar
Compartilhar
Denunciar
Compartilhar
1 de 47
Baixar agora
Baixar para ler offline
Recomendados
Sails js
Sails js
Andrey Kolodnitsky
Intro to Sails.js
Intro to Sails.js
DevOpsDays Austin 2014
Sails.js Intro
Sails.js Intro
Nicholas Jansma
Sails Framework Instroduction
Sails Framework Instroduction
Leo Berdu
NodeWay in my project & sails.js
NodeWay in my project & sails.js
Dmytro Ovcharenko
Javascript Bundling and modularization
Javascript Bundling and modularization
stbaechler
Build RESTful API Using Express JS
Build RESTful API Using Express JS
Cakra Danu Sedayu
Angular2 ecosystem
Angular2 ecosystem
Kamil Lelonek
Recomendados
Sails js
Sails js
Andrey Kolodnitsky
Intro to Sails.js
Intro to Sails.js
DevOpsDays Austin 2014
Sails.js Intro
Sails.js Intro
Nicholas Jansma
Sails Framework Instroduction
Sails Framework Instroduction
Leo Berdu
NodeWay in my project & sails.js
NodeWay in my project & sails.js
Dmytro Ovcharenko
Javascript Bundling and modularization
Javascript Bundling and modularization
stbaechler
Build RESTful API Using Express JS
Build RESTful API Using Express JS
Cakra Danu Sedayu
Angular2 ecosystem
Angular2 ecosystem
Kamil Lelonek
Node.js Express Framework
Node.js Express Framework
TheCreativedev Blog
WordCamp Ann Arbor 2015 Introduction to Backbone + WP REST API
WordCamp Ann Arbor 2015 Introduction to Backbone + WP REST API
Brian Hogg
Developing Rest services with SailsJs by Andrey Kolodnitskiy
Developing Rest services with SailsJs by Andrey Kolodnitskiy
Lohika_Odessa_TechTalks
Build Your Own CMS with Apache Sling
Build Your Own CMS with Apache Sling
Bob Paulin
Packing for the Web with Webpack
Packing for the Web with Webpack
Thiago Temple
Express JS
Express JS
Designveloper
The Evolution of Airbnb's Frontend
The Evolution of Airbnb's Frontend
Spike Brehm
Ansible 101 - Presentation at Ansible STL Meetup
Ansible 101 - Presentation at Ansible STL Meetup
Jeff Geerling
RESTful web apps with Apache Sling - 2013 version
RESTful web apps with Apache Sling - 2013 version
Bertrand Delacretaz
RESTful Web Applications with Apache Sling
RESTful Web Applications with Apache Sling
Bertrand Delacretaz
Content-centric architectures - case study : Apache Sling
Content-centric architectures - case study : Apache Sling
Fabrice Hong
JBoss, Rails and the cloud
JBoss, Rails and the cloud
elliando dias
An Overview on Nuxt.js
An Overview on Nuxt.js
Squash Apps Pvt Ltd
Spring Boot Update
Spring Boot Update
Sergi Almar i Graupera
The SPDY Protocol
The SPDY Protocol
Fabian Lange
Секретный доклад о React Router - OdessaJS 2014
Секретный доклад о React Router - OdessaJS 2014
Andrey Listochkin
遠端團隊專案建立與管理 remote team management 2016
遠端團隊專案建立與管理 remote team management 2016
Caesar Chi
WordPress as the Backbone(.js)
WordPress as the Backbone(.js)
Beau Lebens
Highly available Drupal on a Raspberry Pi cluster
Highly available Drupal on a Raspberry Pi cluster
Jeff Geerling
Module design pattern i.e. express js
Module design pattern i.e. express js
Ahmed Assaf
[2019.02.16] hst - orm
[2019.02.16] hst - orm
Chia-Hao Tsai
MYSQL Query Anti-Patterns That Can Be Moved to Sphinx
MYSQL Query Anti-Patterns That Can Be Moved to Sphinx
Pythian
Mais conteúdo relacionado
Mais procurados
Node.js Express Framework
Node.js Express Framework
TheCreativedev Blog
WordCamp Ann Arbor 2015 Introduction to Backbone + WP REST API
WordCamp Ann Arbor 2015 Introduction to Backbone + WP REST API
Brian Hogg
Developing Rest services with SailsJs by Andrey Kolodnitskiy
Developing Rest services with SailsJs by Andrey Kolodnitskiy
Lohika_Odessa_TechTalks
Build Your Own CMS with Apache Sling
Build Your Own CMS with Apache Sling
Bob Paulin
Packing for the Web with Webpack
Packing for the Web with Webpack
Thiago Temple
Express JS
Express JS
Designveloper
The Evolution of Airbnb's Frontend
The Evolution of Airbnb's Frontend
Spike Brehm
Ansible 101 - Presentation at Ansible STL Meetup
Ansible 101 - Presentation at Ansible STL Meetup
Jeff Geerling
RESTful web apps with Apache Sling - 2013 version
RESTful web apps with Apache Sling - 2013 version
Bertrand Delacretaz
RESTful Web Applications with Apache Sling
RESTful Web Applications with Apache Sling
Bertrand Delacretaz
Content-centric architectures - case study : Apache Sling
Content-centric architectures - case study : Apache Sling
Fabrice Hong
JBoss, Rails and the cloud
JBoss, Rails and the cloud
elliando dias
An Overview on Nuxt.js
An Overview on Nuxt.js
Squash Apps Pvt Ltd
Spring Boot Update
Spring Boot Update
Sergi Almar i Graupera
The SPDY Protocol
The SPDY Protocol
Fabian Lange
Секретный доклад о React Router - OdessaJS 2014
Секретный доклад о React Router - OdessaJS 2014
Andrey Listochkin
遠端團隊專案建立與管理 remote team management 2016
遠端團隊專案建立與管理 remote team management 2016
Caesar Chi
WordPress as the Backbone(.js)
WordPress as the Backbone(.js)
Beau Lebens
Highly available Drupal on a Raspberry Pi cluster
Highly available Drupal on a Raspberry Pi cluster
Jeff Geerling
Module design pattern i.e. express js
Module design pattern i.e. express js
Ahmed Assaf
Mais procurados
(20)
Node.js Express Framework
Node.js Express Framework
WordCamp Ann Arbor 2015 Introduction to Backbone + WP REST API
WordCamp Ann Arbor 2015 Introduction to Backbone + WP REST API
Developing Rest services with SailsJs by Andrey Kolodnitskiy
Developing Rest services with SailsJs by Andrey Kolodnitskiy
Build Your Own CMS with Apache Sling
Build Your Own CMS with Apache Sling
Packing for the Web with Webpack
Packing for the Web with Webpack
Express JS
Express JS
The Evolution of Airbnb's Frontend
The Evolution of Airbnb's Frontend
Ansible 101 - Presentation at Ansible STL Meetup
Ansible 101 - Presentation at Ansible STL Meetup
RESTful web apps with Apache Sling - 2013 version
RESTful web apps with Apache Sling - 2013 version
RESTful Web Applications with Apache Sling
RESTful Web Applications with Apache Sling
Content-centric architectures - case study : Apache Sling
Content-centric architectures - case study : Apache Sling
JBoss, Rails and the cloud
JBoss, Rails and the cloud
An Overview on Nuxt.js
An Overview on Nuxt.js
Spring Boot Update
Spring Boot Update
The SPDY Protocol
The SPDY Protocol
Секретный доклад о React Router - OdessaJS 2014
Секретный доклад о React Router - OdessaJS 2014
遠端團隊專案建立與管理 remote team management 2016
遠端團隊專案建立與管理 remote team management 2016
WordPress as the Backbone(.js)
WordPress as the Backbone(.js)
Highly available Drupal on a Raspberry Pi cluster
Highly available Drupal on a Raspberry Pi cluster
Module design pattern i.e. express js
Module design pattern i.e. express js
Semelhante a Sails.js Model / ORM introduce
[2019.02.16] hst - orm
[2019.02.16] hst - orm
Chia-Hao Tsai
MYSQL Query Anti-Patterns That Can Be Moved to Sphinx
MYSQL Query Anti-Patterns That Can Be Moved to Sphinx
Pythian
ITB2017 - Slaying the ORM dragons with cborm
ITB2017 - Slaying the ORM dragons with cborm
Ortus Solutions, Corp
Bye bye $GLOBALS['TYPO3_DB']
Bye bye $GLOBALS['TYPO3_DB']
Jan Helke
Sequelize js
Sequelize js
Joan Yin
Rik Hepworth - ARM Yourself for Effective Azure Provisioning
Rik Hepworth - ARM Yourself for Effective Azure Provisioning
WinOps Conf
Infrastructure as Code on Azure: Show your Bicep!
Infrastructure as Code on Azure: Show your Bicep!
Marco Obinu
Infrastructure as code with Amazon Web Services
Infrastructure as code with Amazon Web Services
Julien SIMON
Online Schema Changes for Maximizing Uptime
Online Schema Changes for Maximizing Uptime
Pythian
High Performance Rails with MySQL
High Performance Rails with MySQL
Jervin Real
Azure Databricks – Customer Experiences and Lessons Denzil Ribeiro Madhu Ganta
Azure Databricks – Customer Experiences and Lessons Denzil Ribeiro Madhu Ganta
Databricks
Webpack: What it is, What it does, Whether you need it
Webpack: What it is, What it does, Whether you need it
Mike Wilcox
Orms vs Micro-ORMs
Orms vs Micro-ORMs
David Paquette
MySQL Performance Tuning. Part 1: MySQL Configuration (includes MySQL 5.7)
MySQL Performance Tuning. Part 1: MySQL Configuration (includes MySQL 5.7)
Aurimas Mikalauskas
Modeling Tricks My Relational Database Never Taught Me
Modeling Tricks My Relational Database Never Taught Me
David Boike
PostgreSQL
PostgreSQL
Reuven Lerner
Use case for using the ElastiCache for Redis in production
Use case for using the ElastiCache for Redis in production
知教 本間
WebObjects Optimization
WebObjects Optimization
WO Community
Amazon Aurora로 안전하게 migration 하기
Amazon Aurora로 안전하게 migration 하기
Jesang Yoon
Orm loveandhate
Orm loveandhate
Wil de Bruin
Semelhante a Sails.js Model / ORM introduce
(20)
[2019.02.16] hst - orm
[2019.02.16] hst - orm
MYSQL Query Anti-Patterns That Can Be Moved to Sphinx
MYSQL Query Anti-Patterns That Can Be Moved to Sphinx
ITB2017 - Slaying the ORM dragons with cborm
ITB2017 - Slaying the ORM dragons with cborm
Bye bye $GLOBALS['TYPO3_DB']
Bye bye $GLOBALS['TYPO3_DB']
Sequelize js
Sequelize js
Rik Hepworth - ARM Yourself for Effective Azure Provisioning
Rik Hepworth - ARM Yourself for Effective Azure Provisioning
Infrastructure as Code on Azure: Show your Bicep!
Infrastructure as Code on Azure: Show your Bicep!
Infrastructure as code with Amazon Web Services
Infrastructure as code with Amazon Web Services
Online Schema Changes for Maximizing Uptime
Online Schema Changes for Maximizing Uptime
High Performance Rails with MySQL
High Performance Rails with MySQL
Azure Databricks – Customer Experiences and Lessons Denzil Ribeiro Madhu Ganta
Azure Databricks – Customer Experiences and Lessons Denzil Ribeiro Madhu Ganta
Webpack: What it is, What it does, Whether you need it
Webpack: What it is, What it does, Whether you need it
Orms vs Micro-ORMs
Orms vs Micro-ORMs
MySQL Performance Tuning. Part 1: MySQL Configuration (includes MySQL 5.7)
MySQL Performance Tuning. Part 1: MySQL Configuration (includes MySQL 5.7)
Modeling Tricks My Relational Database Never Taught Me
Modeling Tricks My Relational Database Never Taught Me
PostgreSQL
PostgreSQL
Use case for using the ElastiCache for Redis in production
Use case for using the ElastiCache for Redis in production
WebObjects Optimization
WebObjects Optimization
Amazon Aurora로 안전하게 migration 하기
Amazon Aurora로 안전하게 migration 하기
Orm loveandhate
Orm loveandhate
Mais de 謝 宗穎
為 Node.js 專案打造專屬管家進行開發流程整合及健康檢測
為 Node.js 專案打造專屬管家進行開發流程整合及健康檢測
謝 宗穎
中華電信 教育訓練
中華電信 教育訓練
謝 宗穎
DevOps 及 TDD 開發流程哲學
DevOps 及 TDD 開發流程哲學
謝 宗穎
Docker summit 2015: 以 Docker Swarm 打造多主機叢集環境
Docker summit 2015: 以 Docker Swarm 打造多主機叢集環境
謝 宗穎
JCConf 2015 workshop 動手玩 Java 專案建置工具
JCConf 2015 workshop 動手玩 Java 專案建置工具
謝 宗穎
JSDC 2015 - TDD 的開發哲學,以 Node.js 為例
JSDC 2015 - TDD 的開發哲學,以 Node.js 為例
謝 宗穎
Scrum 開發流程導入經驗分享
Scrum 開發流程導入經驗分享
謝 宗穎
TDD 實戰
TDD 實戰
謝 宗穎
從軟體開發角度 談 Docker 的應用
從軟體開發角度 談 Docker 的應用
謝 宗穎
Mais de 謝 宗穎
(9)
為 Node.js 專案打造專屬管家進行開發流程整合及健康檢測
為 Node.js 專案打造專屬管家進行開發流程整合及健康檢測
中華電信 教育訓練
中華電信 教育訓練
DevOps 及 TDD 開發流程哲學
DevOps 及 TDD 開發流程哲學
Docker summit 2015: 以 Docker Swarm 打造多主機叢集環境
Docker summit 2015: 以 Docker Swarm 打造多主機叢集環境
JCConf 2015 workshop 動手玩 Java 專案建置工具
JCConf 2015 workshop 動手玩 Java 專案建置工具
JSDC 2015 - TDD 的開發哲學,以 Node.js 為例
JSDC 2015 - TDD 的開發哲學,以 Node.js 為例
Scrum 開發流程導入經驗分享
Scrum 開發流程導入經驗分享
TDD 實戰
TDD 實戰
從軟體開發角度 談 Docker 的應用
從軟體開發角度 談 Docker 的應用
Último
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
The Digital Insurer
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
Enterprise Knowledge
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
Puma Security, LLC
Slack Application Development 101 Slides
Slack Application Development 101 Slides
praypatel2
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
Results
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
Maria Levchenko
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
Martijn de Jong
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
Delhi Call girls
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Igalia
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
Delhi Call girls
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Drew Madelung
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
Delhi Call girls
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Miguel Araújo
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
Anna Loughnan Colquhoun
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
Radu Cotescu
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
gurkirankumar98700
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Neo4j
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
Sinan KOZAK
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
Rafal Los
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j
Último
(20)
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
Slack Application Development 101 Slides
Slack Application Development 101 Slides
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Sails.js Model / ORM introduce
1.
Sails.js Model /
ORM introduce
2.
http://sailsjs.org/
3.
sails 0.10 beta •
sails-0.10.0-reference • .done() vs. .exec() • Model Associations • sails console • promises in core
4.
sails upgrade 0.10
beta • npm i sails@beta -g • npm i sails@beta -save • npm i sails-mysql@beta -save • npm i sails-mongo@beta -save
5.
• config/connections.js •
addconfig/models.js DB Setting
6.
7.
Why you need
ORM ?
8.
How Create Table? traditional
way
9.
SHOW CREATE TABLE
`post`; ! ALTER TABLE `post` ADD `title`VARCHAR(100) NULL DEFAULT NULL AFTER `id`; ! ALTER TABLE `post` ADD `content` TEXT DEFAULT NULL AFTER `title`; MySQL
10.
MySQL
11.
SELECT * FROM
`post` WHERE `id` = '1' LIMIT 1; MySQL
12.
MySQL
13.
Terrible happened • DB
schema modify • Multi tables join • Migrate Table or Database • Change adapter • more ...
14.
Can we controller Model
from Code???
15.
ORM Objective Orient Model
16.
Object Orented
17.
adpters
18.
one of best
practices
19.
Sql & Nosql
20.
SQL vs. MongoDB
21.
Waterline Sails.js ORM module
22.
Model • file path
-> api/models • Capital naming • Set schema and rule. • ORM like • you can use multi-adapter
23.
Model Associations • sails
0.10 new Feature • Many-to-Many • One-to-Many • One-to-One
24.
Disk database (default)
25.
Adapter support • MySQL •
MongoDB • Redis • ... • http://sailsjs.org/#!documentation/models
26.
Adapter config
27.
• config/connections.js •
addconfig/models.js DB Setting
28.
Attribute type • string •
text • integer • float • date • time • datetime • boolean • binary • array • json
29.
Custom Defined Instance
Methods
30.
example, api/models/Post.js
31.
example, api/models/Post.js generate a
table and column
32.
Auto migration
33.
example2, api/models/Post.js insert a
attribute in Post model
34.
Before and After
35.
Lifecycle Callbacks sails model
36.
37.
define Model Associations
38.
One to One
39.
One to Many
40.
Controller and Model
41.
example, controller call
Post model
42.
example, controller call
Post model model name
43.
example, controller call
Post model model behavior
44.
example, controller call
Post model new data
45.
example, controller call
Post model success callback & response
46.
Model document http://sailsjs.org/#!documentation/models
47.
• User.create({name:"smlsun"}).exec(console.log); • Post.create({title:"post",
content:"body", user: 1}).exec(console.log); • Post.create({title:"post another", content:"body", user: 1}).exec(console.log); • Post.find().exec(console.log); • Post.find().populate("user").exec(console.log); • User.find().populate("posts").exec(console.log); • Profile.create({email: "smlsun@gmail.com", user: 1}).exec(console.log) • Profile.find().populate("user").exec(console.log);
Baixar agora