knex.jsSQL 查询构建器
knex.js 是一个查询构建器,用于 PostgreSQL, MySQL 和 SQLite3。它设计灵活,轻便和有趣。
特性:
例子:
var knex = require('knex')({ dialect: 'sqlite3', connection: { filename: './data.db' } }); // Create a table knex.schema.createTable('users', function(table) { table.increments('id'); table.string('user_name'); }) // ...and another .createTable('accounts', function(table) { table.increments('id'); table.string('account_name'); table.integer('user_id').unsigned().references('users.id'); }) // Then query the table... .then(function() { return knex.insert({user_name: 'Tim'}).into('users'); }) // ...and using the insert id, insert into the other table. .then(function(rows) { return knex.table('accounts').insert({account_name: 'knex', user_id: rows[0]}); }) // Query both of the rows. .then(function() { return knex('users') .join('accounts', 'users.id', 'accounts.user_id') .select('users.user_name as user', 'accounts.account_name as account'); }) // .map over the results .map(function(row) { console.log(row); }) // Finally, add a .catch handler for the promise chain .catch(function(e) { console.error(e); });
评论
ElasticQueryElasticSearch 查询构建器
ElasticQuery 是用于 ElasticSearch 的简单查询构建器。可使用 metod
ElasticQueryElasticSearch 查询构建器
0
ElasticQueryElasticSearch 查询构建器
ElasticQuery是用于ElasticSearch的简单查询构建器。可使用metod方法调用和相应的参数来生成查询、过滤和聚合对象。输出的dict/json可直接传递给ES。示例代码:from
ElasticQueryElasticSearch 查询构建器
0
GantGroovy 构建器
Gant是一个基于Ant的构建工具,它采用Groovy脚本代替XML来编写构建逻辑。Gant完全依赖于Anttask来做真正的事情,所以你如果用Ant实现构建,但不喜欢用XML构建文件,Gant是一个
GantGroovy 构建器
0
PAYFormBuilderiOS 表单构建器
PAYFormBuilder是平滑风格,可验证的iOS表单,带有自定义的DSL。FormBuilder是一个可以创建普遍适用iOS7/8屏幕的简单方法。
PAYFormBuilderiOS 表单构建器
0
formtasticRails 表单构建器
formtastic是一个Rails表单构建器插件,提供语义丰富和可访问的标记。示例代码:<%=semantic_form_for@postdo|f|%><%=f.inputsdo%
formtasticRails 表单构建器
0