Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var orm = require('orm');
- var db = orm.connect({
- host: 'localhost',
- database: 'ofp',
- user: 'root',
- password: 'password',
- protocol: 'mysql',
- port: '3306',
- }, function (err, db) {
- if (err) return console.error('Connection error: ' + err);
- });
- var Teacher = db.define('teacher', {
- name: {type: 'text', size: 90, key: true},
- post: {type: 'text', size: 90},
- qualification: {type: 'text', size: 90},
- authority: {type: 'boolean'}
- }, {
- methods : {
- getTeacherName: function() {
- return this.name;
- },
- getTeacherPost: function () {
- return this.post;
- },
- getTeacherQualification: function () {
- return this.qualification;
- },
- getTeacherAuthority: function () {
- return this.authority;
- }
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement