gpt4 book ai didi

mysql - 如何在nodejs中创建mysql模式

转载 作者:IT王子 更新时间:2023-10-28 23:50:03 26 4
gpt4 key购买 nike

我正在为我的数据库使用 nodejs、express 框架和 mysql。我想知道如何使用 mysql 复制这个 Mongoose 代码。我找不到在 nodejs 文件中编写我的 sql 模式的方法。我必须为此使用工作台吗?谢谢!

var mongoose = require('mongoose');

var userSchema = mongoose.Schema({
local: {
username: String,
password: String
}
});

module.exports = mongoose.model('User', userSchema);

最佳答案

您可以使用以下任何一种:
书架
膝盖
异议
奥姆
续集

查看两者之间的比较:

https://npmcompare.com/compare/bookshelf,knex,objection,orm,sequelize

本教程可能会帮助您使用“sequelize”: Creating a Role-Based User Authentication System with Angular, Express and MySQL

关于mysql - 如何在nodejs中创建mysql模式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34039489/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com