同步操作将从 mirrors_Unitech/node-orm2 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
To add a database adapter to orm
, call its addAdapter
method:
require('orm2').addAdapter('cassandra', CassandraAdapter);
The first argument is the alias to register for connection URLs. For example, the above will allow you to do this:
var orm = require('orm2');
orm.connect('cassandra://username:password@localhost/test', function (err, db) { });
The second argument is the constructor for your adapter object.
Your adapter should provide the following members.
The adapter object constructor should have three parameters:
href
path
of href
get(key)
and set(key, value)
methods to manipulate the settings. The
following settings are defined:
name
and field
parameter that returns the name of the
column that establishes the associationThis should be set to true
if your database is a SQL database.
Your adapter should have a customTypes
object, with the property names being the names of the custom types, and each
value being the options relating to the type.
Establishes your database connection.
Establishes/re-establishes a connection. The optional prior connection is passed in the connection
parameter.
Tests whether your connection is still alive.
Closes your database connection.
Maps an object property to the correlated value to use for the database.
Maps a database value to the property value to use for the mapped object.
Implement this to select and return data stored in the database. See the documentation for Model.find.
Inserts an object into a database table.
Updates an object in the appropriate database row.
Implement this to support the removal of an object from a table.
Implement this to support Model.count.
Implement this to support Model.clear
, which deletes all objects from a given table.
Implement this to support eager loading of associated objects.
For SQL databases, the Query
object from the sql-query
package used to generate ad-hoc queries.
For SQL databases, returns a Query
object from the sql-query
package.
For SQL databases, this executes a Query
object from the sql-query
package.
If your adapter supports SQL aggregate functions, this should be an array of supported function names.
If your adapter maintains associations in a unique (non-SQL-like) manner, return an object from this method to implement a one-to-many association. The return value should have the following methods:
If your adapter supports creating a table from a model, implement this method. The following options are passed:
If your adapter supports dropping a table, implement this method. The following options are passed to this method:
Your adapter should be an EventEmitter
, and should emit the error
event when applicable.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。