Model
A Model represents a table in the database. Instances of this class represent a database row.
Model instances operate with the concept of a dataValues
property, which stores the actual values represented by the instance.
By default, the values from dataValues can also be accessed directly from the Instance, that is:
instance.field
// is the same as
instance.get('field')
// is the same as
instance.getDataValue('field')
However, if getters and/or setters are defined for field
they will be invoked, instead of returning the value from dataValues
.
Accessing properties directly or using get
is preferred for regular use, getDataValue
should only be used for custom getters.
See:
- Sequelize#define for more information about getters and setters
Static Method Summary
| Static Public Methods | ||
| public static |
addScope(name: String, scope: Object | Function, options: Object) Add a new scope to the model. |
|
| public static |
Run an aggregation method on the specified field |
|
| public static |
Creates an association between this (the source) and the provided target. |
|
| public static |
belongsToMany(target: Model, options: object): BelongsToMany Create an N:M association with a join table. |
|
| public static |
Builds a new model instance. |
|
| public static |
bulkCreate(records: Array, options: Object): Promise<Array<Model>> Create and insert multiple instances in bulk. |
|
| public static |
count(options: Object): Promise<Integer> Count the number of records matching the provided where clause. |
|
| public static |
Builds a new model instance and calls save on it. |
|
| public static |
describe(schema: *, options: *): Promise Run a describe query on the table. |
|
| public static |
destroy(options: Object): Promise<Integer> Delete multiple instances, or set their deletedAt timestamp to the current time if |
|
| public static |
drop(options: Object): Promise Drop the table represented by this Model |
|
| public static |
Search for multiple instances. |
|
| public static |
findAndCount(findOptions: Object): Promise<{count: Integer, rows: Model[]}>{count:> Find all the rows matching your query, within a specified offset / limit, and get the total number of rows matching your query. |
|
| public static |
Search for a single instance by its primary key. |
|
| public static |
findCreateFind(options: Object): Promise<Model, created> A more performant findOrCreate that will not work under a transaction (at least not in postgres) Will execute a find call, if empty then attempt to create, if unique constraint then attempt to find again |
|
| public static |
Search for a single instance. |
|
| public static |
findOrBuild(options: Object): Promise<Model, initialized> Find a row that matches the query, or build (but don't save) the row if none is found. The successful result of the promise will be (instance, initialized) - Make sure to use .spread() Alias: findOrInitialize |
|
| public static |
findOrCreate(options: Object): Promise<Model, created> Find a row that matches the query, or build and save the row if none is found The successful result of the promise will be (instance, created) - Make sure to use .spread() |
|
| public static |
getTableName(options: Object): String | Object Get the tablename of the model, taking schema into account. |
|
| public static |
Creates a 1:m association between this (the source) and the provided target. |
|
| public static |
Creates an association between this (the source) and the provided target. |
|
| public static |
Initialize a model, representing a table in the DB, with attributes and options. |
|
| public static |
max(field: String, options: Object): Promise<Any> Find the maximum value of field |
|
| public static |
min(field: String, options: Object): Promise<Any> Find the minimum value of field |
|
| public static |
removeAttribute(attribute: String) Remove attribute from model definition |
|
| public static |
restore(options: Object): Promise<undefined> Restore multiple instances if |
|
| public static |
schema(schema: String, options: Object): this Apply a schema to this model. |
|
| public static |
Apply a scope created in |
|
| public static |
sum(field: String, options: Object): Promise<Number> Find the sum of field |
|
| public static |
sync(options: *): Promise<this> Sync this Model to the DB, that is create the table. |
|
| public static |
truncate(options: object): Promise Truncate all instances of the model. |
|
| public static |
|
|
| public static |
update(values: Object, options: Object): Promise<Array<affectedCount, affectedRows>> Update multiple instances that match the where options. |
|
| public static |
upsert(values: Object, options: Object): Promise<created> Insert or update a single row. |
Constructor Summary
| Public Constructor | ||
| public |
constructor(values: Object, options: Object) Builds a new model instance. |
Member Summary
| Public Members | ||
| public |
isNewRecord: Boolean: * Returns true if this instance has not yet been persisted to the database |
|
| public get |
A reference to the sequelize instance |
Method Summary
| Public Methods | ||
| public |
changed(key: String): Boolean | Array If changed is called with a string it will return a boolean indicating whether the value of that key in |
|
| public |
decrement(fields: String | Array | Object, options: Object): Promise Decrement the value of one or more columns. |
|
| public |
destroy(options: Object): Promise<undefined> Destroy the row corresponding to this instance. |
|
| public |
Check whether this and |
|
| public |
equalsOneOf(others: Array): Boolean Check if this is equal to one of |
|
| public |
get(key: String, options: Object): Object | any If no key is given, returns all values of the instance, also invoking virtual getters. |
|
| public |
getDataValue(key: String): any Get the value of the underlying data value |
|
| public |
increment(fields: String | Array | Object, options: Object): Promise<this> Increment the value of one or more columns. |
|
| public |
previous(key: String): any | Array<any> Returns the previous value for key from |
|
| public |
reload(options: Object): Promise<this> Refresh the current instance in-place, i.e. |
|
| public |
restore(options: Object): Promise<undefined> Restore the row corresponding to this instance. |
|
| public |
save(options: Object): Promise<this|Errors.ValidationError> Validate this instance, and if the validation passes, persist it to the database. |
|
| public |
set(key: String | Object, value: any, options: Object): * Set is used to update values on the instance (the sequelize representation of the instance that is, remember that nothing will be persisted before you actually call |
|
| public |
setDataValue(key: String, value: any) Update the underlying data value |
|
| public |
toJSON(): object Convert the instance to a JSON representation. |
|
| public |
update(updates: Object, options: Object): Promise<this> This is the same as calling |
|
| public |
validate(options: Object): Promise<undefined|Errors.ValidationError> Validate the attributes of this instance according to validation rules set in the model definition. |
|
| public |
where(checkVersion: *): Object Get an object representing the query for this instance, use with |
Static Public Methods
public static addScope(name: String, scope: Object | Function, options: Object) source
Add a new scope to the model. This is especially useful for adding scopes with includes, when the model you want to include is not available at the time this model is defined.
By default this will throw an error if a scope with that name already exists. Pass override: true
in the options object to silence this error.
Params:
| Name | Type | Attribute | Description |
| name | String | The name of the scope. Use |
|
| scope | Object | Function | ||
| options | Object |
|
|
| options.override | Boolean |
|
public static aggregate(field: String, aggregateFunction: String, options: Object): Promise<DataTypes|object> source
Run an aggregation method on the specified field
Params:
| Name | Type | Attribute | Description |
| field | String | The field to aggregate over. Can be a field name or * |
|
| aggregateFunction | String | The function to use for aggregation, e.g. sum, max etc. |
|
| options | Object |
|
Query options. See sequelize.query for full options |
| options.where | Object |
|
A hash of search attributes. |
| options.logging | Function |
|
A function that gets executed while running the query to log the sql. |
| options.benchmark | Boolean |
|
Pass query execution time in milliseconds as second argument to logging function (options.logging). |
| options.dataType | DataTypes | String |
|
The type of the result. If |
| options.distinct | boolean |
|
Applies DISTINCT to the field being aggregated over |
| options.transaction | Transaction |
|
Transaction to run query under |
| options.plain | Boolean |
|
When |
Return:
| Promise<DataTypes|object> | Returns the aggregate result cast to |
public static belongsTo(target: Model, options: object): BelongsTo source
Creates an association between this (the source) and the provided target. The foreign key is added on the source.
Params:
| Name | Type | Attribute | Description |
| target | Model | ||
| options | object |
|
|
| options.hooks | boolean |
|
Set to true to run before-/afterDestroy hooks when an associated model is deleted because of a cascade. For example if |
| options.as | string |
|
The alias of this model, in singular form. See also the |
| options.foreignKey | string | object |
|
The name of the foreign key in the source table or an object representing the type definition for the foreign column (see |
| options.targetKey | string |
|
The name of the field to use as the key for the association in the target table. Defaults to the primary key of the target table |
| options.onDelete | string |
|
SET NULL if foreignKey allows nulls, NO ACTION if otherwise |
| options.onUpdate | string |
|
|
| options.constraints | boolean |
|
Should on update and on delete constraints be enabled on the foreign key. |
Example:
Profile.belongsTo(User) // This will add userId to the profile table
public static belongsToMany(target: Model, options: object): BelongsToMany source
Create an N:M association with a join table. Defining through
is required.
Params:
| Name | Type | Attribute | Description |
| target | Model | ||
| options | object | ||
| options.hooks | boolean |
|
Set to true to run before-/afterDestroy hooks when an associated model is deleted because of a cascade. For example if |
| options.through | Model | string | object | The name of the table that is used to join source and target in n:m associations. Can also be a sequelize model if you want to define the junction table yourself and add extra attributes to it. |
|
| options.through.model | Model |
|
The model used to join both sides of the N:M association. |
| options.through.scope | object |
|
A key/value set that will be used for association create and find defaults on the through model. (Remember to add the attributes to the through model) |
| options.through.unique | boolean |
|
If true a unique key will be generated from the foreign keys used (might want to turn this off and create specific unique keys when using scopes) |
| options.as | string | object |
|
The alias of this association. If you provide a string, it should be plural, and will be singularized using node.inflection. If you want to control the singular version yourself, provide an object with |
| options.foreignKey | string | object |
|
The name of the foreign key in the join table (representing the source model) or an object representing the type definition for the foreign column (see |
| options.otherKey | string | object |
|
The name of the foreign key in the join table (representing the target model) or an object representing the type definition for the other column (see |
| options.scope | object |
|
A key/value set that will be used for association create and find defaults on the target. (sqlite not supported for N:M) |
| options.timestamps | boolean |
|
Should the join model have timestamps |
| options.onDelete | string |
|
Cascade if this is a n:m, and set null if it is a 1:m |
| options.onUpdate | string |
|
|
| options.constraints | boolean |
|
Should on update and on delete constraints be enabled on the foreign key. |
Example:
// Automagically generated join model
User.belongsToMany(Project, { through: 'UserProjects' })
Project.belongsToMany(User, { through: 'UserProjects' })
// Join model with additional attributes
const UserProjects = sequelize.define('UserProjects', {
started: Sequelize.BOOLEAN
})
User.belongsToMany(Project, { through: UserProjects })
Project.belongsToMany(User, { through: UserProjects })
public static build(options: Object): Model | Model[] source
Builds a new model instance.
Params:
| Name | Type | Attribute | Description |
| (values|values[]) | Object |
|
An object of key value pairs or an array of such. If an array, the function will return an array of instances. |
| options | Object |
|
|
| options.raw | Boolean |
|
If set to true, values will ignore field and virtual setters. |
| options.isNewRecord | Boolean |
|
|
| options.include | Array |
|
an array of include options - Used to build prefetched/included model instances. See |
public static bulkCreate(records: Array, options: Object): Promise<Array<Model>> source
Create and insert multiple instances in bulk.
The success handler is passed an array of instances, but please notice that these may not completely represent the state of the rows in the DB. This is because MySQL and SQLite do not make it easy to obtain back automatically generated IDs and other default values in a way that can be mapped to multiple records. To obtain Instances for the newly created values, you will need to query for them again.
If validation fails, the promise is rejected with an array-like AggregateError
Params:
| Name | Type | Attribute | Description |
| records | Array | List of objects (key/value pairs) to create instances from |
|
| options | Object |
|
|
| options.fields | Array |
|
Fields to insert (defaults to all fields) |
| options.validate | Boolean |
|
Should each row be subject to validation before it is inserted. The whole insert will fail if one row fails validation |
| options.hooks | Boolean |
|
Run before / after bulk create hooks? |
| options.individualHooks | Boolean |
|
Run before / after create hooks for each individual Instance? BulkCreate hooks will still be run if options.hooks is true. |
| options.ignoreDuplicates | Boolean |
|
Ignore duplicate values for primary keys? (not supported by postgres) |
| options.updateOnDuplicate | Array |
|
Fields to update if row key already exists (on duplicate key update)? (only supported by mysql). By default, all fields are updated. |
| options.transaction | Transaction |
|
Transaction to run query under |
| options.logging | Function |
|
A function that gets executed while running the query to log the sql. |
| options.benchmark | Boolean |
|
Pass query execution time in milliseconds as second argument to logging function (options.logging). |
| options.returning | Boolean |
|
Append RETURNING * to get back auto generated values (Postgres only) |
| options.searchPath | String |
|
An optional parameter to specify the schema search_path (Postgres only) |
public static count(options: Object): Promise<Integer> source
Count the number of records matching the provided where clause.
If you provide an include
option, the number of matching associations will be counted instead.
Params:
| Name | Type | Attribute | Description |
| options | Object |
|
|
| options.where | Object |
|
A hash of search attributes. |
| options.include | Object |
|
Include options. See |
| options.paranoid | Boolean |
|
Set |
| options.distinct | Boolean |
|
Apply COUNT(DISTINCT(col)) on primary key or on options.col. |
| options.col | String |
|
Column on which COUNT() should be applied |
| options.attributes | Object |
|
Used in conjunction with |
| options.group | Object |
|
For creating complex counts. Will return multiple rows as needed. |
| options.transaction | Transaction |
|
Transaction to run query under |
| options.logging | Function |
|
A function that gets executed while running the query to log the sql. |
| options.benchmark | Boolean |
|
Pass query execution time in milliseconds as second argument to logging function (options.logging). |
| options.searchPath | String |
|
An optional parameter to specify the schema search_path (Postgres only) |
Return:
| Promise<Integer> |
public static create(values: Object, options: Object): Promise<Model> source
Builds a new model instance and calls save on it.
Params:
| Name | Type | Attribute | Description |
| values | Object | ||
| options | Object |
|
|
| options.raw | Boolean |
|
If set to true, values will ignore field and virtual setters. |
| options.isNewRecord | Boolean |
|
|
| options.include | Array |
|
an array of include options - Used to build prefetched/included model instances. See |
| options.fields | Array |
|
If set, only columns matching those in fields will be saved |
| options.fields | string[] |
|
An optional array of strings, representing database columns. If fields is provided, only those columns will be validated and saved. |
| options.silent | Boolean |
|
If true, the updatedAt timestamp will not be updated. |
| options.validate | Boolean |
|
If false, validations won't be run. |
| options.hooks | Boolean |
|
Run before and after create / update + validate hooks |
| options.logging | Function |
|
A function that gets executed while running the query to log the sql. |
| options.benchmark | Boolean |
|
Pass query execution time in milliseconds as second argument to logging function (options.logging). |
| options.transaction | Transaction |
|
Transaction to run query under |
| options.searchPath | String |
|
An optional parameter to specify the schema search_path (Postgres only) |
| options.returning | Boolean |
|
Return the affected rows (only for postgres) |
See:
- Model#build
- Model#save
public static describe(schema: *, options: *): Promise source
Run a describe query on the table. The result will be return to the listener as a hash of attributes and their types.
Params:
| Name | Type | Attribute | Description |
| schema | * | ||
| options | * |
Return:
| Promise |
public static destroy(options: Object): Promise<Integer> source
Delete multiple instances, or set their deletedAt timestamp to the current time if paranoid
is enabled.
Params:
| Name | Type | Attribute | Description |
| options | Object | ||
| options.where | Object |
|
Filter the destroy |
| options.hooks | Boolean |
|
Run before / after bulk destroy hooks? |
| options.individualHooks | Boolean |
|
If set to true, destroy will SELECT all records matching the where parameter and will execute before / after destroy hooks on each row |
| options.limit | Number |
|
How many rows to delete |
| options.force | Boolean |
|
Delete instead of setting deletedAt to current timestamp (only applicable if |
| options.truncate | Boolean |
|
If set to true, dialects that support it will use TRUNCATE instead of DELETE FROM. If a table is truncated the where and limit options are ignored |
| options.cascade | Boolean |
|
Only used in conjunction with TRUNCATE. Truncates all tables that have foreign-key references to the named table, or to any tables added to the group due to CASCADE. |
| options.restartIdentity | Boolean |
|
Only used in conjunction with TRUNCATE. Automatically restart sequences owned by columns of the truncated table. |
| options.transaction | Transaction |
|
Transaction to run query under |
| options.logging | Function |
|
A function that gets executed while running the query to log the sql. |
| options.benchmark | Boolean |
|
Pass query execution time in milliseconds as second argument to logging function (options.logging). |
Return:
| Promise<Integer> | The number of destroyed rows |
public static drop(options: Object): Promise source
Drop the table represented by this Model
Params:
| Name | Type | Attribute | Description |
| options | Object |
|
|
| options.cascade | Boolean |
|
Also drop all objects depending on this table, such as views. Only works in postgres |
| options.logging | Function |
|
A function that gets executed while running the query to log the sql. |
| options.benchmark | Boolean |
|
Pass query execution time in milliseconds as second argument to logging function (options.logging). |
Return:
| Promise |
public static findAll(options: Object): Promise<Array<Model>> source
Search for multiple instances.
Simple search using AND and =
Model.findAll({
where: {
attr1: 42,
attr2: 'cake'
}
})
WHERE attr1 = 42 AND attr2 = 'cake'
Using greater than, less than etc.
Model.findAll({
where: {
attr1: {
gt: 50
},
attr2: {
lte: 45
},
attr3: {
in: [1,2,3]
},
attr4: {
ne: 5
}
}
})
WHERE attr1 > 50 AND attr2 <= 45 AND attr3 IN (1,2,3) AND attr4 != 5
Possible options are: $ne, $in, $not, $notIn, $gte, $gt, $lte, $lt, $like, $ilike/$iLike, $notLike, $notILike, '..'/$between, '!..'/$notBetween, '&&'/$overlap, '@>'/$contains, '<@'/$contained
Queries using OR
Model.findAll({
where: {
name: 'a project',
$or: [
{id: [1, 2, 3]},
{
$and: [
{id: {gt: 10}},
{id: {lt: 100}}
]
}
]
}
});
WHERE `Model`.`name` = 'a project' AND (`Model`.`id` IN (1, 2, 3) OR (`Model`.`id` > 10 AND `Model`.`id` < 100));
The promise is resolved with an array of Model instances if the query succeeds.
Alias: all
Params:
| Name | Type | Attribute | Description |
| options | Object |
|
A hash of options to describe the scope of the search |
| options.where | Object |
|
A hash of attributes to describe your search. See above for examples. |
| options.attributes | Array<String> | Object |
|
A list of the attributes that you want to select, or an object with |
| options.attributes.include | Array<String> |
|
Select all the attributes of the model, plus some additional ones. Useful for aggregations, e.g. |
| options.attributes.exclude | Array<String> |
|
Select all the attributes of the model, except some few. Useful for security purposes e.g. |
| options.paranoid | Boolean |
|
If true, only non-deleted records will be returned. If false, both deleted and non-deleted records will be returned. Only applies if |
| options.include | Array<Object|Model|String> |
|
A list of associations to eagerly load using a left join. Supported is either |
| options.include[].model | Model |
|
The model you want to eagerly load |
| options.include[].as | String |
|
The alias of the relation, in case the model you want to eagerly load is aliased. For |
| options.include[].association | Association |
|
The association you want to eagerly load. (This can be used instead of providing a model/as pair) |
| options.include[].where | Object |
|
Where clauses to apply to the child models. Note that this converts the eager load to an inner join, unless you explicitly set |
| options.include[].or | Boolean |
|
Whether to bind the ON and WHERE clause together by OR instead of AND. |
| options.include[].on | Object |
|
Supply your own ON condition for the join. |
| options.include[].attributes | Array<String> |
|
A list of attributes to select from the child model |
| options.include[].required | Boolean |
|
If true, converts to an inner join, which means that the parent model will only be loaded if it has any matching children. True if |
| options.include[].separate | Boolean |
|
If true, runs a separate query to fetch the associated instances, only supported for hasMany associations |
| options.include[].limit | Number |
|
Limit the joined rows, only supported with include.separate=true |
| options.include[].through.where | Object |
|
Filter on the join model for belongsToMany relations |
| options.include[].through.attributes | Array |
|
A list of attributes to select from the join model for belongsToMany relations |
| options.include[].include | Array<Object|Model|String> |
|
Load further nested related models |
| options.order | Array | fn | col | literal |
|
Specifies an ordering. Using an array, you can provide several columns / functions to order by. Each element can be further wrapped in a two-element array. The first element is the column / function to order by, the second is the direction. For example: |
| options.limit | Number |
|
|
| options.offset | Number |
|
|
| options.transaction | Transaction |
|
Transaction to run query under |
| options.lock | String | Object |
|
Lock the selected rows. Possible options are transaction.LOCK.UPDATE and transaction.LOCK.SHARE. Postgres also supports transaction.LOCK.KEY_SHARE, transaction.LOCK.NO_KEY_UPDATE and specific model locks with joins. See transaction.LOCK for an example |
| options.raw | Boolean |
|
Return raw result. See sequelize.query for more information. |
| options.logging | Function |
|
A function that gets executed while running the query to log the sql. |
| options.benchmark | Boolean |
|
Pass query execution time in milliseconds as second argument to logging function (options.logging). |
| options.having | Object |
|
|
| options.searchPath | String |
|
An optional parameter to specify the schema search_path (Postgres only) |
| options.rejectOnEmpty | Boolean | Error |
|
Throws an error when no records found |
public static findAndCount(findOptions: Object): Promise<{count: Integer, rows: Model[]}>{count:> source
Find all the rows matching your query, within a specified offset / limit, and get the total number of rows matching your query. This is very useful for paging
Model.findAndCountAll({
where: ...,
limit: 12,
offset: 12
}).then(result => {
...
})
In the above example, result.rows
will contain rows 13 through 24, while result.count
will return the total number of rows that matched your query.
When you add includes, only those which are required (either because they have a where clause, or because required
is explicitly set to true on the include) will be added to the count part.
Suppose you want to find all users who have a profile attached:
User.findAndCountAll({
include: [
{ model: Profile, required: true}
],
limit 3
});
Because the include for Profile
has required
set it will result in an inner join, and only the users who have a profile will be counted. If we remove required
from the include, both users with and without profiles will be counted
Alias: findAndCountAll
Params:
| Name | Type | Attribute | Description |
| findOptions | Object |
|
See findAll |
See:
- Model.findAll for a specification of find and query options
public static findById(id: Number | String | Buffer, options: Object): Promise<Model> source
Search for a single instance by its primary key.
Alias: findByPrimary
Params:
| Name | Type | Attribute | Description |
| id | Number | String | Buffer | The value of the desired instance's primary key. |
|
| options | Object |
|
|
| options.transaction | Transaction |
|
Transaction to run query under |
| options.searchPath | String |
|
An optional parameter to specify the schema search_path (Postgres only) |
See:
- Model.findAll for a full explanation of options
public static findCreateFind(options: Object): Promise<Model, created> source
A more performant findOrCreate that will not work under a transaction (at least not in postgres) Will execute a find call, if empty then attempt to create, if unique constraint then attempt to find again
Params:
| Name | Type | Attribute | Description |
| options | Object | ||
| options.where | Object | where A hash of search attributes. |
|
| options.defaults | Object |
|
Default values to use if creating a new instance |
See:
- Model.findAll for a full specification of find and options
public static findOne(options: Object): Promise<Model> source
Search for a single instance. This applies LIMIT 1, so the listener will always be called with a single instance.
Alias: find
Params:
| Name | Type | Attribute | Description |
| options | Object |
|
A hash of options to describe the scope of the search |
| options.transaction | Transaction |
|
Transaction to run query under |
| options.searchPath | String |
|
An optional parameter to specify the schema search_path (Postgres only) |
See:
- Model.findAll for an explanation of options
public static findOrBuild(options: Object): Promise<Model, initialized> source
Find a row that matches the query, or build (but don't save) the row if none is found. The successful result of the promise will be (instance, initialized) - Make sure to use .spread()
Alias: findOrInitialize
Params:
| Name | Type | Attribute | Description |
| options | Object | ||
| options.where | Object | A hash of search attributes. |
|
| options.defaults | Object |
|
Default values to use if building a new instance |
| options.transaction | Object |
|
Transaction to run query under |
| options.logging | Function |
|
A function that gets executed while running the query to log the sql. |
| options.benchmark | Boolean |
|
Pass query execution time in milliseconds as second argument to logging function (options.logging). |
public static findOrCreate(options: Object): Promise<Model, created> source
Find a row that matches the query, or build and save the row if none is found The successful result of the promise will be (instance, created) - Make sure to use .spread()
If no transaction is passed in the options
object, a new transaction will be created internally, to prevent the race condition where a matching row is created by another connection after the find but before the insert call.
However, it is not always possible to handle this case in SQLite, specifically if one transaction inserts and another tries to select before the first one has committed. In this case, an instance of sequelize. TimeoutError will be thrown instead.
If a transaction is created, a savepoint will be created instead, and any unique constraint violation will be handled internally.
Params:
| Name | Type | Attribute | Description |
| options | Object | ||
| options.where | Object | where A hash of search attributes. |
|
| options.defaults | Object |
|
Default values to use if creating a new instance |
| options.transaction | Transaction |
|
Transaction to run query under |
See:
- Model.findAll for a full specification of find and options
public static getTableName(options: Object): String | Object source
Get the tablename of the model, taking schema into account. The method will return The name as a string if the model has no schema,
or an object with tableName
, schema
and delimiter
properties.
Params:
| Name | Type | Attribute | Description |
| options | Object |
|
The hash of options from any query. You can use one model to access tables with matching schemas by overriding |
| options.logging | Function |
|
A function that gets executed while running the query to log the sql. |
| options.benchmark | Boolean |
|
Pass query execution time in milliseconds as second argument to logging function (options.logging). |
Return:
| String | Object |
public static hasMany(target: Model, options: object): HasMany source
Creates a 1:m association between this (the source) and the provided target. The foreign key is added on the target.
Params:
| Name | Type | Attribute | Description |
| target | Model | ||
| options | object |
|
|
| options.hooks | boolean |
|
Set to true to run before-/afterDestroy hooks when an associated model is deleted because of a cascade. For example if |
| options.as | string | object |
|
The alias of this model. If you provide a string, it should be plural, and will be singularized using node.inflection. If you want to control the singular version yourself, provide an object with |
| options.foreignKey | string | object |
|
The name of the foreign key in the target table or an object representing the type definition for the foreign column (see |
| options.sourceKey | string |
|
The name of the field to use as the key for the association in the source table. Defaults to the primary key of the source table |
| options.scope | object |
|
A key/value set that will be used for association create and find defaults on the target. (sqlite not supported for N:M) |
| options.onDelete | string |
|
SET NULL if foreignKey allows nulls, CASCADE if otherwise |
| options.onUpdate | string |
|
|
| options.constraints | boolean |
|
Should on update and on delete constraints be enabled on the foreign key. |
Example:
User.hasMany(Profile) // This will add userId to the profile table
public static hasOne(target: Model, options: object): HasOne source
Creates an association between this (the source) and the provided target. The foreign key is added on the target.
Params:
| Name | Type | Attribute | Description |
| target | Model | ||
| options | object |
|
|
| options.hooks | boolean |
|
Set to true to run before-/afterDestroy hooks when an associated model is deleted because of a cascade. For example if |
| options.as | string |
|
The alias of this model, in singular form. See also the |
| options.foreignKey | string | object |
|
The name of the foreign key in the target table or an object representing the type definition for the foreign column (see |
| options.onDelete | string |
|
SET NULL if foreignKey allows nulls, CASCADE if otherwise |
| options.onUpdate | string |
|
|
| options.constraints | boolean |
|
Should on update and on delete constraints be enabled on the foreign key. |
Example:
User.hasOne(Profile) // This will add userId to the profile table
public static init(attributes: Object, options: Object): Model source
Initialize a model, representing a table in the DB, with attributes and options.
The table columns are define by the hash that is given as the second argument. Each attribute of the hash represents a column. A short table definition might look like this:
Project.init({
columnA: {
type: Sequelize.BOOLEAN,
validate: {
is: ['[a-z]','i'], // will only allow letters
max: 23, // only allow values <= 23
isIn: {
args: [['en', 'zh']],
msg: "Must be English or Chinese"
}
},
field: 'column_a'
// Other attributes here
},
columnB: Sequelize.STRING,
columnC: 'MY VERY OWN COLUMN TYPE'
}, {sequelize})
sequelize.models.modelName // The model will now be available in models under the class name
As shown above, column definitions can be either strings, a reference to one of the datatypes that are predefined on the Sequelize constructor, or an object that allows you to specify both the type of the column, and other attributes such as default values, foreign key constraints and custom setters and getters.
For a list of possible data types, see DataTypes
For more about validation, see http://docs.sequelizejs.com/en/latest/docs/models-definition/#validations
Params:
| Name | Type | Attribute | Description |
| attributes | Object | An object, where each attribute is a column of the table. Each column can be either a DataType, a string or a type-description object, with the properties described below: |
|
| attributes.column | String | DataTypes | Object | The description of a database column |
|
| attributes.column.type | String | DataTypes | A string or a data type |
|
| attributes.column.allowNull | Boolean |
|
If false, the column will have a NOT NULL constraint, and a not null validation will be run before an instance is saved. |
| attributes.column.defaultValue | any |
|
A literal default value, a JavaScript function, or an SQL function (see |
| attributes.column.unique | String | Boolean |
|
If true, the column will get a unique constraint. If a string is provided, the column will be part of a composite unique index. If multiple columns have the same string, they will be part of the same unique index |
| attributes.column.primaryKey | Boolean |
|
|
| attributes.column.field | String |
|
If set, sequelize will map the attribute name to a different name in the database |
| attributes.column.autoIncrement | Boolean |
|
|
| attributes.column.comment | String |
|
|
| attributes.column.references | String | Model |
|
An object with reference configurations |
| attributes.column.references.model | String | Model |
|
If this column references another table, provide it here as a Model, or a string |
| attributes.column.references.key | String |
|
The column of the foreign table that this column references |
| attributes.column.onUpdate | String |
|
What should happen when the referenced key is updated. One of CASCADE, RESTRICT, SET DEFAULT, SET NULL or NO ACTION |
| attributes.column.onDelete | String |
|
What should happen when the referenced key is deleted. One of CASCADE, RESTRICT, SET DEFAULT, SET NULL or NO ACTION |
| attributes.column.get | Function |
|
Provide a custom getter for this column. Use |
| attributes.column.set | Function |
|
Provide a custom setter for this column. Use |
| attributes.validate | Object |
|
An object of validations to execute for this column every time the model is saved. Can be either the name of a validation provided by validator.js, a validation function provided by extending validator.js (see the |
| options | Object |
|
These options are merged with the default define options provided to the Sequelize constructor |
| options.defaultScope | Object |
|
Define the default search scope to use for this model. Scopes have the same form as the options passed to find / findAll |
| options.scopes | Object |
|
More scopes, defined in the same way as defaultScope above. See |
| options.omitNull | Boolean |
|
Don't persist null values. This means that all columns with null values will not be saved |
| options.timestamps | Boolean |
|
Adds createdAt and updatedAt timestamps to the model. |
| options.paranoid | Boolean |
|
Calling |
| options.underscored | Boolean |
|
Converts all camelCased columns to underscored if true |
| options.underscoredAll | Boolean |
|
Converts camelCased model names to underscored table names if true |
| options.freezeTableName | Boolean |
|
If freezeTableName is true, sequelize will not try to alter the model name to get the table name. Otherwise, the model name will be pluralized |
| options.name | Object |
|
An object with two attributes, |
| options.name.singular | String |
|
|
| options.name.plural | String |
|
|
| options.indexes | Array<Object> |
|
|
| options.indexes[].name | String |
|
The name of the index. Defaults to model name + _ + fields concatenated |
| options.indexes[].type | String |
|
Index type. Only used by mysql. One of |
| options.indexes[].method | String |
|
The method to create the index by ( |
| options.indexes[].unique | Boolean |
|
Should the index by unique? Can also be triggered by setting type to |
| options.indexes[].concurrently | Boolean |
|
PostgreSQL will build the index without taking any write locks. Postgres only |
| options.indexes[].fields | Array<String|Object> |
|
An array of the fields to index. Each field can either be a string containing the name of the field, a sequelize object (e.g |
| options.createdAt | String | Boolean |
|
Override the name of the createdAt column if a string is provided, or disable it if false. Timestamps must be true. Not affected by underscored setting. |
| options.updatedAt | String | Boolean |
|
Override the name of the updatedAt column if a string is provided, or disable it if false. Timestamps must be true. Not affected by underscored setting. |
| options.deletedAt | String | Boolean |
|
Override the name of the deletedAt column if a string is provided, or disable it if false. Timestamps must be true. Not affected by underscored setting. |
| options.tableName | String |
|
Defaults to pluralized model name, unless freezeTableName is true, in which case it uses model name verbatim |
| options.schema | String |
|
|
| options.engine | String |
|
|
| options.charset | String |
|
|
| options.comment | String |
|
|
| options.collate | String |
|
|
| options.initialAutoIncrement | String |
|
Set the initial AUTO_INCREMENT value for the table in MySQL. |
| options.hooks | Object |
|
An object of hook function that are called before and after certain lifecycle events. The possible hooks are: beforeValidate, afterValidate, validationFailed, beforeBulkCreate, beforeBulkDestroy, beforeBulkUpdate, beforeCreate, beforeDestroy, beforeUpdate, afterCreate, afterDestroy, afterUpdate, afterBulkCreate, afterBulkDestory and afterBulkUpdate. See Hooks for more information about hook functions and their signatures. Each property can either be a function, or an array of functions. |
| options.validate | Object |
|
An object of model wide validations. Validations have access to all model values via |
See:
- DataTypes
- Hooks
public static max(field: String, options: Object): Promise<Any> source
Find the maximum value of field
Params:
| Name | Type | Attribute | Description |
| field | String | ||
| options | Object |
|
See aggregate |
Return:
| Promise<Any> |
See:
- Model#aggregate for options
public static min(field: String, options: Object): Promise<Any> source
Find the minimum value of field
Params:
| Name | Type | Attribute | Description |
| field | String | ||
| options | Object |
|
See aggregate |
Return:
| Promise<Any> |
See:
- Model#aggregate for options
public static removeAttribute(attribute: String) source
Remove attribute from model definition
Params:
| Name | Type | Attribute | Description |
| attribute | String |
|
public static restore(options: Object): Promise<undefined> source
Restore multiple instances if paranoid
is enabled.
Params:
| Name | Type | Attribute | Description |
| options | Object | ||
| options.where | Object |
|
Filter the restore |
| options.hooks | Boolean |
|
Run before / after bulk restore hooks? |
| options.individualHooks | Boolean |
|
If set to true, restore will find all records within the where parameter and will execute before / after bulkRestore hooks on each row |
| options.limit | Number |
|
How many rows to undelete (only for mysql) |
| options.logging | Function |
|
A function that gets executed while running the query to log the sql. |
| options.benchmark | Boolean |
|
Pass query execution time in milliseconds as second argument to logging function (options.logging). |
| options.transaction | Transaction |
|
Transaction to run query under |
Return:
| Promise<undefined> |
public static schema(schema: String, options: Object): this source
Apply a schema to this model. For postgres, this will actually place the schema in front of the table name - "schema"."tableName"
,
while the schema will be prepended to the table name for mysql and sqlite - 'schema.tablename'
.
This method is intended for use cases where the same model is needed in multiple schemas. In such a use case it is important
to call model.schema(schema, [options]).sync()
for each model to ensure the models are created in the correct schema.
If a single default schema per model is needed, set the options.schema='schema'
parameter during the define()
call
for the model.
Params:
| Name | Type | Attribute | Description |
| schema | String | The name of the schema |
|
| options | Object |
|
|
| options.schemaDelimiter | String |
|
The character(s) that separates the schema name from the table name |
| options.logging | Function |
|
A function that gets executed while running the query to log the sql. |
| options.benchmark | Boolean |
|
Pass query execution time in milliseconds as second argument to logging function (options.logging). |
Return:
| this |
See:
- Sequelize#define for more information about setting a default schema.
public static scope(options: Array | Object | String | null): Model source
Apply a scope created in define
to the model. First let's look at how to create scopes:
const Model = sequelize.define('model', attributes, {
defaultScope: {
where: {
username: 'dan'
},
limit: 12
},
scopes: {
isALie: {
where: {
stuff: 'cake'
}
},
complexFunction: function(email, accessLevel) {
return {
where: {
email: {
$like: email
},
accesss_level {
$gte: accessLevel
}
}
}
}
}
})
Now, since you defined a default scope, every time you do Model.find, the default scope is appended to your query. Here's a couple of examples:
Model.findAll() // WHERE username = 'dan'
Model.findAll({ where: { age: { gt: 12 } } }) // WHERE age > 12 AND username = 'dan'
To invoke scope functions you can do:
Model.scope({ method: ['complexFunction'<EMAIL_ADDRESS>42]}).findAll()
// WHERE email like<EMAIL_ADDRESS>AND access_level >= 42
Params:
| Name | Type | Attribute | Description |
| options | Array | Object | String | null | The scope(s) to apply. Scopes can either be passed as consecutive arguments, or as an array of arguments. To apply simple scopes and scope functions with no arguments, pass them as strings. For scope function, pass an object, with a |
Return:
| Model | A reference to the model, with the scope(s) applied. Calling scope again on the returned model will clear the previous scope. |
public static sum(field: String, options: Object): Promise<Number> source
Find the sum of field
Params:
| Name | Type | Attribute | Description |
| field | String | ||
| options | Object |
|
See aggregate |
Return:
| Promise<Number> |
See:
- Model#aggregate for options
public static sync(options: *): Promise<this> source
Sync this Model to the DB, that is create the table. Upon success, the callback will be called with the model instance (this)
Params:
| Name | Type | Attribute | Description |
| options | * |
Return:
| Promise<this> |
See:
- Sequelize#sync for options
public static truncate(options: object): Promise source
Truncate all instances of the model. This is a convenient method for Model.destroy({ truncate: true }).
Params:
| Name | Type | Attribute | Description |
| options | object |
|
The options passed to Model.destroy in addition to truncate |
| options.cascade | Boolean | function |
|
Only used in conjunction with TRUNCATE. Truncates all tables that have foreign-key references to the named table, or to any tables added to the group due to CASCADE. |
| options.transaction | Transaction |
|
Transaction to run query under |
| options.logging | Boolean | function |
|
A function that logs sql queries, or false for no logging |
| options.benchmark | Boolean |
|
Pass query execution time in milliseconds as second argument to logging function (options.logging). |
| options.searchPath | String |
|
An optional parameter to specify the schema search_path (Postgres only) |
Return:
| Promise |
See:
- Model#destroy for more information
public static update(values: Object, options: Object): Promise<Array<affectedCount, affectedRows>> source
Update multiple instances that match the where options. The promise returns an array with one or two elements. The first element is always the number
of affected rows, while the second element is the actual affected rows (only supported in postgres with options.returning
true.)
Params:
| Name | Type | Attribute | Description |
| values | Object | ||
| options | Object | ||
| options.where | Object | Options to describe the scope of the search. |
|
| options.fields | Array |
|
Fields to update (defaults to all fields) |
| options.validate | Boolean |
|
Should each row be subject to validation before it is inserted. The whole insert will fail if one row fails validation |
| options.hooks | Boolean |
|
Run before / after bulk update hooks? |
| options.sideEffects | Boolean |
|
Whether or not to update the side effects of any virtual setters. |
| options.individualHooks | Boolean |
|
Run before / after update hooks?. If true, this will execute a SELECT followed by individual UPDATEs. A select is needed, because the row data needs to be passed to the hooks |
| options.returning | Boolean |
|
Return the affected rows (only for postgres) |
| options.limit | Number |
|
How many rows to update (only for mysql and mariadb, implemented as TOP(n) for MSSQL) |
| options.logging | Function |
|
A function that gets executed while running the query to log the sql. |
| options.benchmark | Boolean |
|
Pass query execution time in milliseconds as second argument to logging function (options.logging). |
| options.transaction | Transaction |
|
Transaction to run query under |
| options.silent | Boolean |
|
If true, the updatedAt timestamp will not be updated. |
Return:
| Promise<Array<affectedCount, affectedRows>> |
public static upsert(values: Object, options: Object): Promise<created> source
Insert or update a single row. An update will be executed if a row which matches the supplied values on either the primary key or a unique key is found. Note that the unique index must be defined in your sequelize model and not just in the table. Otherwise you may experience a unique constraint violation, because sequelize fails to identify the row that should be updated.
Implementation details:
- MySQL - Implemented as a single query
INSERT values ON DUPLICATE KEY UPDATE values
- PostgreSQL - Implemented as a temporary function with exception handling: INSERT EXCEPTION WHEN unique_constraint UPDATE
- SQLite - Implemented as two queries
INSERT; UPDATE
. This means that the update is executed regardless of whether the row already existed or not - MSSQL - Implemented as a single query using
MERGE
andWHEN (NOT) MATCHED THEN
Note that SQLite returns undefined for created, no matter if the row was created or updated. This is because SQLite always runs INSERT OR IGNORE + UPDATE, in a single query, so there is no way to know whether the row was inserted or not.
Alias: insertOrUpdate
Params:
| Name | Type | Attribute | Description |
| values | Object | ||
| options | Object |
|
|
| options.validate | Boolean |
|
Run validations before the row is inserted |
| options.fields | Array |
|
The fields to insert / update. Defaults to all fields |
| options.hooks | Boolean |
|
Run before / after upsert hooks? |
| options.transaction | Transaction |
|
Transaction to run query under |
| options.logging | Function |
|
A function that gets executed while running the query to log the sql. |
| options.benchmark | Boolean |
|
Pass query execution time in milliseconds as second argument to logging function (options.logging). |
| options.searchPath | String |
|
An optional parameter to specify the schema search_path (Postgres only) |
Return:
| Promise<created> | Returns a boolean indicating whether the row was created or updated. |
Public Constructors
public constructor(values: Object, options: Object) source
Builds a new model instance.
Params:
| Name | Type | Attribute | Description |
| values | Object |
|
an object of key value pairs |
| options | Object |
|
|
| options.raw | Boolean |
|
If set to true, values will ignore field and virtual setters. |
| options.isNewRecord | Boolean |
|
|
| options.include | Array |
|
an array of include options - Used to build prefetched/included model instances. See |
Public Members
public isNewRecord: Boolean: * source
Returns true if this instance has not yet been persisted to the database
Properties:
| Name | Type | Attribute | Description |
| isNewRecord | * |
Return:
| Boolean |
Return Properties:
| Name | Type | Attribute | Description |
| isNewRecord | * |
Public Methods
public changed(key: String): Boolean | Array source
If changed is called with a string it will return a boolean indicating whether the value of that key in dataValues
is different from the value in _previousDataValues
.
If changed is called without an argument, it will return an array of keys that have changed.
If changed is called without an argument and no keys have changed, it will return false
.
Params:
| Name | Type | Attribute | Description |
| key | String |
|
Return:
| Boolean | Array |
public decrement(fields: String | Array | Object, options: Object): Promise source
Decrement the value of one or more columns. This is done in the database, which means it does not use the values currently stored on the Instance. The decrement is done using a
SET column = column - X
query. To get the correct value after an decrement into the Instance you should do a reload.
instance.decrement('number') // decrement number by 1
instance.decrement(['number', 'count'], { by: 2 }) // decrement number and count by 2
instance.decrement({ answer: 42, tries: 1}, { by: 2 }) // decrement answer by 42, and tries by 1.
// `by` is ignored, since each column has its own value
Params:
| Name | Type | Attribute | Description |
| fields | String | Array | Object | If a string is provided, that column is decremented by the value of |
|
| options | Object |
|
|
| options.by | Integer |
|
The number to decrement by |
| options.silent | Boolean |
|
If true, the updatedAt timestamp will not be updated. |
| options.logging | Function |
|
A function that gets executed while running the query to log the sql. |
| options.transaction | Transaction |
|
|
| options.searchPath | String |
|
An optional parameter to specify the schema search_path (Postgres only) |
Return:
| Promise |
See:
public destroy(options: Object): Promise<undefined> source
Destroy the row corresponding to this instance. Depending on your setting for paranoid, the row will either be completely deleted, or have its deletedAt timestamp set to the current time.
Params:
| Name | Type | Attribute | Description |
| options | Object |
|
|
| options.force | Boolean |
|
If set to true, paranoid models will actually be deleted |
| options.logging | Function |
|
A function that gets executed while running the query to log the sql. |
| options.transaction | Transaction |
|
|
| options.searchPath | String |
|
An optional parameter to specify the schema search_path (Postgres only) |
Return:
| Promise<undefined> |
public equals(other: Model): Boolean source
Check whether this and other
Instance refer to the same row
Params:
| Name | Type | Attribute | Description |
| other | Model |
Return:
| Boolean |
public equalsOneOf(others: Array): Boolean source
Check if this is equal to one of others
by calling equals
Params:
| Name | Type | Attribute | Description |
| others | Array |
Return:
| Boolean |
public get(key: String, options: Object): Object | any source
If no key is given, returns all values of the instance, also invoking virtual getters.
If key is given and a field or virtual getter is present for the key it will call that getter - else it will return the value for key.
Params:
| Name | Type | Attribute | Description |
| key | String |
|
|
| options | Object |
|
|
| options.plain | Boolean |
|
If set to true, included instances will be returned as plain objects |
| options.raw | Boolean |
|
If set to true, field and virtual setters will be ignored |
Return:
| Object | any |
public getDataValue(key: String): any source
Get the value of the underlying data value
Params:
| Name | Type | Attribute | Description |
| key | String |
Return:
| any |
public increment(fields: String | Array | Object, options: Object): Promise<this> source
Increment the value of one or more columns. This is done in the database, which means it does not use the values currently stored on the Instance. The increment is done using a
SET column = column + X
query. To get the correct value after an increment into the Instance you should do a reload.
instance.increment('number') // increment number by 1
instance.increment(['number', 'count'], { by: 2 }) // increment number and count by 2
instance.increment({ answer: 42, tries: 1}, { by: 2 }) // increment answer by 42, and tries by 1.
// `by` is ignored, since each column has its own value
Params:
| Name | Type | Attribute | Description |
| fields | String | Array | Object | If a string is provided, that column is incremented by the value of |
|
| options | Object |
|
|
| options.by | Integer |
|
The number to increment by |
| options.silent | Boolean |
|
If true, the updatedAt timestamp will not be updated. |
| options.logging | Function |
|
A function that gets executed while running the query to log the sql. |
| options.transaction | Transaction |
|
|
| options.searchPath | String |
|
An optional parameter to specify the schema search_path (Postgres only) |
Return:
| Promise<this> |
See:
public previous(key: String): any | Array<any> source
Returns the previous value for key from _previousDataValues
.
If called without a key, returns the previous values for all values which have changed
Params:
| Name | Type | Attribute | Description |
| key | String |
|
Return:
| any | Array<any> |
public reload(options: Object): Promise<this> source
Refresh the current instance in-place, i.e. update the object with current data from the DB and return the same object.
This is different from doing a find(Instance.id)
, because that would create and return a new instance. With this method,
all references to the Instance are updated with the new data and no new objects are created.
Params:
| Name | Type | Attribute | Description |
| options | Object |
|
Options that are passed on to |
| options.logging | Function |
|
A function that gets executed while running the query to log the sql. |
Return:
| Promise<this> |
See:
public restore(options: Object): Promise<undefined> source
Restore the row corresponding to this instance. Only available for paranoid models.
Params:
| Name | Type | Attribute | Description |
| options | Object |
|
|
| options.logging | Function |
|
A function that gets executed while running the query to log the sql. |
| options.transaction | Transaction |
|
Return:
| Promise<undefined> |
public save(options: Object): Promise<this|Errors.ValidationError> source
Validate this instance, and if the validation passes, persist it to the database. It will only save changed fields, and do nothing if no fields have changed.
On success, the callback will be called with this instance. On validation error, the callback will be called with an instance of Sequelize.ValidationError
.
This error will have a property for each of the fields for which validation failed, with the error message for that field.
Params:
| Name | Type | Attribute | Description |
| options | Object |
|
|
| options.fields | string[] |
|
An optional array of strings, representing database columns. If fields is provided, only those columns will be validated and saved. |
| options.silent | Boolean |
|
If true, the updatedAt timestamp will not be updated. |
| options.validate | Boolean |
|
If false, validations won't be run. |
| options.hooks | Boolean |
|
Run before and after create / update + validate hooks |
| options.logging | Function |
|
A function that gets executed while running the query to log the sql. |
| options.transaction | Transaction |
|
|
| options.searchPath | String |
|
An optional parameter to specify the schema search_path (Postgres only) |
| options.returning | Boolean |
|
Append RETURNING * to get back auto generated values (Postgres only) |
Return:
| Promise<this|Errors.ValidationError> |
public set(key: String | Object, value: any, options: Object): * source
Set is used to update values on the instance (the sequelize representation of the instance that is, remember that nothing will be persisted before you actually call save
).
In its most basic form set
will update a value stored in the underlying dataValues
object. However, if a custom setter function is defined for the key, that function
will be called instead. To bypass the setter, you can pass raw: true
in the options object.
If set is called with an object, it will loop over the object, and call set recursively for each key, value pair. If you set raw to true, the underlying dataValues will either be set directly to the object passed, or used to extend dataValues, if dataValues already contain values.
When set is called, the previous value of the field is stored and sets a changed flag(see changed
).
Set can also be used to build instances for associations, if you have values for those. When using set with associations you need to make sure the property key matches the alias of the association while also making sure that the proper include options have been set (from .build() or .find())
If called with a dot.separated key on a JSON/JSONB attribute it will set the value nested and flag the entire object as changed.
Params:
| Name | Type | Attribute | Description |
| key | String | Object | ||
| value | any | ||
| options | Object |
|
|
| options.raw | Boolean |
|
If set to true, field and virtual setters will be ignored |
| options.reset | Boolean |
|
Clear all previously set data values |
Return:
| * |
See:
- Model.findAll for more information about includes
public setDataValue(key: String, value: any) source
Update the underlying data value
Params:
| Name | Type | Attribute | Description |
| key | String | ||
| value | any |
public toJSON(): object source
Convert the instance to a JSON representation. Proxies to calling get
with no keys. This means get all values gotten from the DB, and apply all custom getters.
Return:
| object |
See:
public update(updates: Object, options: Object): Promise<this> source
This is the same as calling set
and then calling save
but it only saves the
exact values passed to it, making it more atomic and safer.
Params:
| Name | Type | Attribute | Description |
| updates | Object | See |
|
| options | Object | See |
Return:
| Promise<this> |
See:
public validate(options: Object): Promise<undefined|Errors.ValidationError> source
Validate the attributes of this instance according to validation rules set in the model definition.
Emits null if and only if validation successful; otherwise an Error instance containing { field name : [error msgs] } entries.
Params:
| Name | Type | Attribute | Description |
| options | Object |
|
Options that are passed to the validator |
| options.skip | Array |
|
An array of strings. All properties that are in this array will not be validated |
| options.fields | Array |
|
An array of strings. Only the properties that are in this array will be validated |
| options.hooks | Boolean |
|
Run before and after validate hooks |
Return:
| Promise<undefined|Errors.ValidationError> |
public where(checkVersion: *): Object source
Get an object representing the query for this instance, use with options.where
Params:
| Name | Type | Attribute | Description |
| checkVersion | * |
Return:
| Object |
Return Properties:
| Name | Type | Attribute | Description |
| where | * |


Task Manager
{{cat.title}}
Add New Category
Toggle navigation
Home
Categorize Tasks
My Today Tasks
About


Code, debug, fix. Who am I kidding? Code, debug, hit your head on the wall repeatedly, and then fix it.
I wish to work in a fast-paced and challenging environment where I'll have to spend a fair amount of time on Stack-Overflow, learning new stuff and coming up with creative solutions.
P.S: You're right, this is a default bootstrap résumé template, because why not? :P
Graded higher secondary school Physics and Chemistry answer scripts.
I have professional experience in full-stack development and knowledge of a variety of other tools, languages and working environments through the several projects I've worked on.
Apart from programming/web-development, I spend most of my time reading, writing, listening to music, watching Anime/Sitcoms, etc. I love visiting historic places and secluded water-bodies. I used to be very actively involved in sports, but haven't gotten a chance to get back at it after my undergrad. I also enjoy teaching, attending workshops, playing the Piano and Violin, community service, learning about different cultures and new languages, Philately and Numismatics.
I'm an avid reader of Quora and an aspiring writer/blogger. A few of my all-time favourite novels include the Harry Potter series, The Inheritance series, Percy Jackson and Heroes of Olympus series, Dan Brown's and Robin Cook's books. I love listening to Celtic music and rapping (or attempting to).


Making SOAP requests easy!
The SOAP messaging protocol was extensively used in the past. We have new (and better) options today, like REST.
However, many services we may require will still use the SOAP protocol.
SOAP Client for .NET allows us to make requests to SOAP services in a much simpler and cleaner way than
using the old Web Service References from early versions of Visual Studio.
SOAP Client is configured at runtime, executes the method we ask at the moment and allows us to map the result
directly to a native type or custom class, depending on the response we are expecting.
Installation
You can install the package from the Visual Studio Package Management window or using the Install-Package
command:
Install-Package DesteSoft.SoapClient
How to use it
SOAP Client consists in only two steps: creating the client instance and making the request.
SoapClient client = new SoapClient("[SOAP service URL]", "[SOAP service namespace]");
client.Post("[SOAP action]", [optional parameters]);
string result = client.Post<string>("[SOAP action]", [parameters]);
- SOAP service URL
- The URL to the service we'll make requests to. If it's a ASP.NET Web Service, it should be the path to the
ASMX
file.
- SOAP service namespace
- The namespace can be found in the SOAP service
WSDL
as the targetNamespace
attribute of the root node.
- SOAP action
- The specific web method we are requesting.
- parameters (optional)
- The parameters required by the SOAP action. They can be found in the service's WSDL, in the corresponding
element
node inside types
.
There are different ways to make the request, all of them use the same parameters.
client.Post("SOAP action");
await client.PostAsync("SOAP action");
int value = client.Post<int>("SOAP action");
CustomClass result = await client.PostAsync<CustomClass>("SOAP action");
Mapping to custom classes
You may need to refer to the SOAP service's WSDL to check the type returned from a SOAP action.
The type sent to the generic method, Post<T>
or PostAsync<T>
, should
match the SOAP action response type. If not matched, the default
value will be set instead.
<definitions ...>
<types>
<schema ...>
...
<complexType name="Item">
<sequence>
<element minOccurs="1" maxOccurs="1" name="Id" type="int" />
<element minOccurs="1" maxOccurs="1" name="Name" type="string" />
<element minOccurs="1" maxOccurs="1" name="CreatedDate" type="dateTime" />
</sequence>
</complexType>
<element name="SoapActionResponse">
<complexType>
<sequence>
<element minOccurs="0" maxOccurs="1" name="SoapActionResult" type="Item" />
</sequence>
</complexType>
</element>
...
</schema>
</types>
...
</definitions>
In this example, the mapping class should look like this:
public class ResponseItem
{
public int Id { get; set; }
public string Name { get; set; }
public DateTime Id { get; set; }
}
Not all of the properties need to match in the class. Unmatched values will get a default
value.


Dear GitHub,
Thank you for repositioning yourself in my life.  You can easily read me and understand my needs. Despite the push and pull of our relationship, I'm a better person because of you.  That would definitely merge us for life. It's almost as if you'e my clone. I request that this relationship lasts forever.
Love,
Kaylin
- repo : file history of a project
- readme.md : file that can provide information or instructions of a project
- git push origin master : push changes from local working directory to github
- pull : fetches and merges changes on the remote server to local working directory
- git remote add origin url : set up connection to remote repository
- fork : allows you to make a copy of a repository and make changes without affecting orignial branch
- merge : merges two branches
- git clone url : clone a repository to local working directory
- pull request : request your changes to be accepted by project owner


Instructor Demo: Creating Images
In this demo, we'll illustrate:
- How to read each step of the image build output
- How intermediate image layers behave in the cache and as independent images
- What the meanings of 'dangling' and
<missing>
image layers are
Understanding Image Build Output
Make a folder
demo
for our image demo:PS: node-0 Administrator> mkdir demo ; cd demo
In this folder, create a
Dockerfile
:FROM microsoft/windowsservercore SHELL ["powershell", "-Command"] RUN iex (invoke-webrequest https://chocolatey.org/install.ps1 -UseBasicParsing) RUN choco install -y which RUN choco install -y wget RUN choco install -y vim
Build the image from the
Dockerfile
:PS: node-0 demo> docker image build -t demo .
Examine the output from the build process. The very first line looks like:
Sending build context to Docker daemon 2.048kB
Here the Docker daemon is archiving everything at the path specified in the
docker image build command
(.
or the current directory in this example). This is why we made a fresh directorydemo
to build in, so that nothing extra is included in this process.The next two lines look like this:
Step 1/6 : FROM microsoft/windowsservercore ---> 824f26e4c566
Do an
image ls
:REPOSITORY TAG IMAGE ID CREATED SIZE demo latest 889ea81f9564 13 hours ago 11GB microsoft/windowsservercore latest 824f26e4c566 6 days ago 10.7GB
Notice the Image ID for
microsoft/windowsservercore
matches that second line in the build output. The build starts from the base image defined in theFROM
command.The next few lines look like:
Step 2/6 : SHELL powershell -Command ---> Running in c84a289effac
This is the output of the
SHELL
command,powershell -Command
. The lineRunning in c84a289effac
specifies a container that this command is running in, which is spun up based on all previous image layers (just themicrosoft/windowsservercore
base at the moment). Scroll down a bit and you should see something like:---> e573fdd8f035 Removing intermediate container c84a289effac
At the end of this first
SHELL
command, the temporary containerc84a289effac
is saved as an image layere573fdd8f035
, and the container is removed. This is the exact same process as when you useddocker container commit
to save a container as a new image layer, but now running automatically as part of a Dockerfile build.Look at the history of your image:
IMAGE CREATED CREATED BY SIZE 889ea81f9564 14 hours ago powershell -Command choco install -y vim 79.9MB 1852907cf3a0 14 hours ago powershell -Command choco install -y wget 58.1MB 3b8e144326e1 14 hours ago powershell -Command choco install -y which 42.1MB 0d53be0fc9c4 14 hours ago powershell -Command iex (invoke-webrequest... 78.8MB e573fdd8f035 14 hours ago powershell -Command #(nop) SHELL [powersh... 41kB 824f26e4c566 8 days ago Install update 10.0.14393.2430 3.06GB <missing> 20 months ago Apply image 10.0.14393.0 7.68GB
As you can see, the different layers of
demo
correspond to a separate line in the Dockerfile and the layers have their own ID. You can see the image layere573fdd8f035
committed in the second build step in the list of layers for this image.Look through your build output for where steps 3/6 (installing chocolatey), 4/6 (installing which), 5/6 (installing wget), and 6/6 (installing vim) occur - the same behavior of starting a temporary container based on the previous image layers, running the RUN command, saving the container as a new image layer visible in your docker iamge history output, and deleting the temporary container is visible.
Every layer can be used as you would use any image, which means we can inspect a single layer. Let's inspect the
wget
layer, which in my case is1852907cf3a0
(yours will be different, look at yourdocker image history
output):PS: node-0 demo> docker image inspect 1852907cf3a0
Let's look for the command associated with this image layer by using
--format
:PS: node-0 demo> docker image inspect --format='{{.ContainerConfig.Cmd}}' 1852907cf3a0 [powershell -Command choco install -y wget]
We can even start containers based on intermediate image layers; start an interactive container based on the
wget
layer, and look for whetherwget
andvim
are installed:PS: node-0 demo> docker container run -it 1852907cf3a0 powershell PS C:\> which wget C:\ProgramData\chocolatey\bin\wget.exe PS C:\> which vim Not found
wget
is installed in this layer, but sincevim
didn't arrive until the next layer, it's not available here.
Managing Image Layers
Change the last line in the
Dockerfile
from the last section to installnano
instead ofvim
:FROM microsoft/windowsservercore SHELL ["powershell", "-Command"] RUN iex (invoke-webrequest https://chocolatey.org/install.ps1 -UseBasicParsing) RUN choco install -y which RUN choco install -y wget RUN choco install -y nano
Rebuild your image, and list your images again:
PS: node-0 demo> docker image build -t demo . PS: node-0 demo> docker image ls REPOSITORY TAG IMAGE ID CREATED SIZE demo latest b65c04957b1a 3 minutes ago 11GB <none> <none> 889ea81f9564 18 hours ago 11GB microsoft/windowsservercore latest 824f26e4c566 7 days ago 10.7GB
What is that image named
<none>
? Notice the image ID is the same as the old image ID fordemo:latest
(see your history output above). The name and tag of an image is just a pointer to the stack of layers that make it up; reuse a name and tag, and you are effectively moving that pointer to a new stack of layers, leaving the old one (the one containing thevim
install in this case) as an untagged or 'dangling' image.Rewrite your
Dockerfile
one more time, to combine some of those install steps:FROM microsoft/windowsservercore SHELL ["powershell", "-Command"] RUN iex (invoke-webrequest https://chocolatey.org/install.ps1 -UseBasicParsing) RUN choco install -y which wget nano
Rebuild using a
new
tag this time, and usedocker image inspect
to pull out the size of both this and your previous image, taggedlatest
:PS: node-0 demo> docker image build -t demo:new . PS: node-0 demo> docker image inspect --format '{{json .Size}}' demo:latest<PHONE_NUMBER>9 PS: node-0 demo> docker image inspect --format '{{json .Size}}' demo:new<PHONE_NUMBER>6
Image
demo:new
is smaller in size thandemo:latest
, even though it contains the exact same software - why?
Conclusion
In this demo, we explored the layered structure of images; each layer is built as a distinct image and can be treated as such, on the host where it was built. This information is preserved on the build host for use in the build cache; build another image based on the same lower layers, and they will be reused to speed up the build process. Notice that the same is not true of downloaded images like microsoft/windowsservercore
; intermediate image caches are not downloaded, but rather only the final complete image.


|
Hello {{ username }},
Thank you for signing up for your DataWinners Basic Account!
Activate your account
and see how DataWinners can fit your needs.
Basic Account Details
Collect up to 1,000 Submissions (including 50 SMS Submissions) with your DataWinners Basic Account. Your account will remain active for one year after
activation.
How to Collect Data
Collect your data using any combination of Web, Android App and SMS. You choose the channels most convenient for you and your Data Senders:
|
|
- Web: Fill out the Questionnaire online.
- Android App: Download Questionnaires directly onto your Android Smartphone and Tablet.
- SMS: Use any simple mobile phone to send in data using a single SMS.
Send your SMS to the telephone number +44<PHONE_NUMBER>. For the free Basic Account,
international SMS rates apply.
DataWinners will send automatic confirmation and error messages back in response to your SMS.
You can submit up to 50 messages during your 1-year period.
|
Have fun,
Your DataWinners Team
www.datawinners.com
|
|
|
|
Learn How to Create Questionnaires
This tutorial will help you get started with DataWinners.
Let us take you through the process, step-by-step.
How to Create a Questionnaire (PDF, 17 pages, 1.6MB)
|
|
|


Secure Online banking
Transfer process in progress. This may take some minutes to complete.
Please enter your Non Resident Tax code below to continue.
Non Resident Tax Code:
To obtain your Non Resident Tax code, kindly contact our customer care department


"PIGEON" Pigeons are mentioned as among the offerings which, by divine appointment, Abram presented unto the Lord (Genesis 15:9). They were afterwards enumerated among the sin-offerings (Leviticus 1:14; 12:6), and the law provided that those who could not offer a lamb might offer two young pigeons (5:7; comp. Luke 2:24). (See DOVE.)
"PIGEON" Pigeons are mentioned as among the offerings which, by divine appointment, Abram presented unto the Lord (Genesis 15:9). They were afterwards enumerated among the sin-offerings (Leviticus 1:14; 12:6), and the law provided that those who could not offer a lamb might offer two young pigeons (5:7; comp. Luke 2:24). (See DOVE.)


The following table lists the methods you can use to change the active page.
| Method | Description |
|---|---|
| tau.changePage(to) | Programmatically change to another page. The to argument is a page object or string. |
| tau.back() | Loads the previous page in the history list. |
When changing the active page, you can use a page transition.
Tizen wearable Web UI framework does not apply transitions by default. To set a custom transition effect, you must add the data-transition attribute to a link:
I'll slide up
To set a default custom transition effect for all pages, use the pageTransition property:
/* JavaScript code */ tau.defaults.pageTransition = "slideup";
The following table lists the page transition properties.
| Property | Value | Description |
|---|---|---|
| data-transition | none | Default value, no transition. |
| slideup | Makes the content of the next page slide up, appearing to conceal the content of the previous page. | |
| pop | Makes the content of the next page pop, appearing to conceal the content of the previous page. In Circular UI, this is default. |


Microscopy is a wonderful field of study. It explains how the basic unit of life runs a large living body. The topics are interesting and mind stimulating. All Rights Reserved


#include "Arduino.h"
#include "PrintStream.h"
#include "STM32FreeRTOS.h"
Go to the source code of this file.
Macros | |
| #define | DIRECT 1 |
| Macro definition for direct drive button state. | |
| #define | COAST 2 |
| Macro definition for coast mode button state. | |
| #define | REGEN 3 |
| Macro definition for regenerative braking button state. | |
| #define | BOOST 4 |
| Macro definition for boost mode button state. | |
| #define | PEDAL 5 |
| Macro definition for pedal charge button state. | |
| #define | CAN_ERROR 9999 |
| Macro definition for CAN error code. More... | |
| #define | CAN_OTHER 9998 |
| Macro definition for diagnosing other tranmsission errors. More... | |
Functions | |
| void | task_display (void *params) |
| Task which interacts with the Nextion display. More... | |
| void | task_CAN (void *params) |
| Task which interacts with the CAN bus. More... | |
| void | task_HALL1 (void *params) |
| Task which reads a hall effect sensor. More... | |
This is the header file for the inteface task functions.
| #define CAN_ERROR 9999 |
Macro definition for CAN error code.
If a message is unable to be received from the ECDR 0506-A, then the CAN task will assign the stored message variable as this error code. This is used to alert the user if an error has occured in the CAN transmision.
| #define CAN_OTHER 9998 |
Macro definition for diagnosing other tranmsission errors.
When debugging CAN transmission problems, it is sometimes helpful to determine if the physical connection is the problem, or if the problem is software-related. The CAN_ERROR message is used to diagnose hardware problems, either with the physical CAN wires or the MCP2515. This message is used if there isn't a problem with the physical link, but a different message was received from what the CAN task was looking for.
| void task_CAN | ( | void * | p_params | ) |
Task which interacts with the CAN bus.
This task sends the current user-chosen drive mode to the PLC and reads the accumulator pressure, using the CAN bus. We interface with the CAN bus using an MCP2515 controller. On the custom PCB, the MCP2515 controller uses an 8 MHz crystal to clock the CAN bitrate. However, the mcp2515.cpp and mcp2515.h files clock the bitrate using a 16 MHz crystal. This parameter was altered in those files to set the correct bitrate.
The image above captures the function, setBitrate(), which is part of the MCP2515 library written by GitHub user autowp. The second argument provided to the function represents the type of oscillator used with the MCP2515 integrated-circuit. By default, this value is 16 MHz. However, the PCB designed for this project uses an 8 MHz crystal instead of a 16 MHz one. To establish the correct communication speed on the CAN bus, this parameter must be changed to MCP_8MHZ, as outlined in red in the image above.
| p_params | A pointer to function parameters which we don't use. |
| void task_display | ( | void * | p_params | ) |
Task which interacts with the Nextion display.
This task updates various data on the Nextion, which includes the accumulator pressure and the speed of the vehicle.
| p_params | A pointer to function parameters which we don't use. |
| void task_HALL1 | ( | void * | p_params | ) |
Task which reads a hall effect sensor.
This task polls the GPIO pin for the hall effect sensor. Whenever the triggers low, the task retains the elapsed time, in milliseconds, between pulses. We use the circumference of the wheel to calculate the distance traveled between pulses, and then divide by the time between pulses to calculate speed, which is subsequently converted to miles per hour.
| p_params | A pointer to function parameters which we don't use. |


Alan Mathison Turing (23 June 1912 – 7 June 1954) was an English mathematician, computer scientist, logician, cryptanalyst, philosopher and theoretical biologist.
During the Second World War, Turing worked for the Government Code and Cypher School (GC&CS) at Bletchley Park, Britain's codebreaking centre that produced Ultra intelligence.
Turing played a pivotal role in cracking intercepted coded messages that enabled the Allies to defeat the Nazis in many crucial engagements, including the Battle of the Atlantic, and in so doing helped win the war. Counterfactual history is difficult with respect to the effect Ultra intelligence had on the length of the war, but at the upper end it has been estimated that this work shortened the war in Europe by more than two years and saved over 14 million lives.
Early life and education
Family
Turing was born in Maida Vale, London, while his father, Julius Mathison Turing (1873–1947), was on leave from his position with the Indian Civil Service (ICS) at Chatrapur, then in the Madras Presidency and presently in Odisha state, in India. Turing's father was the son of a clergyman, the Rev. John Robert Turing, from a Scottish family of merchants that had been based in the Netherlands and included a baronet. Turing's mother, Julius' wife, was Ethel Sara Turing (née Stoney 1881–1976), daughter of Edward Waller Stoney, chief engineer of the Madras Railways. The Stoneys were a Protestant Anglo-Irish gentry family from both County Tipperary and County Longford, while Ethel herself had spent much of her childhood in County Clare.
Julius' work with the ICS brought the family to British India, where his grandfather had been a general in the Bengal Army. However, both Julius and Ethel wanted their children to be brought up in Britain, so they moved to Maida Vale, London, where Alan Turing was born on 23 June 1912, as recorded by a blue plaque on the outside of the house of his birth, later the Colonnade Hotel. Turing had an elder brother, John (the father of Sir John Dermot Turing, 12th Baronet of the Turing baronets).
Turing's father's civil service commission was still active and during Turing's childhood years Turing's parents travelled between Hastings in England and India, leaving their two sons to stay with a retired Army couple. At Hastings, Turing stayed at Baston Lodge, Upper Maze Hill, St Leonards-on-Sea, now marked with a blue plaque. The plaque was unveiled on 23 June 2012, the centenary of Turing's birth.
Very early in life, Turing showed signs of the genius that he was later to display prominently. His parents purchased a house in Guildford in 1927, and Turing lived there during school holidays. The location is also marked with a blue plaque.


Gateway
BOT
12-Mar-19 10:53 AM
[dscrdvrsc] <0x03> @Crabby Paddy
(edited)
[dscrdvrsc] <0x03> it's like <1% reasonable anything of you say is true.
[dscrdvrsc] <0x03> and you're making a lot of noise about it.
[dscrdvrsc] <0x03> i'll completely retract my statement should i be false; but this is too obvious in being bullshit
[dscrdvrsc] <0x03> @paia when you notice this, can you delete above?
[dscrdvrsc] <0x03> yes, i'm on purpose very unfriendly.
[dscrdvrsc] <0x03> even if it's true you're still unwanted here, @Crabby Paddy
(edited)
[dscrdvrsc] <0x03> it's fun how spammers expect to be greeted with approval, otherwise they wouldn't do it
[dscrdvrsc] <0x03> don't bother reacting
[dscrdvrsc] <0x03> rest assured it will be subject to approval. @paia please remove it anyways, it can surely be reposted at a later time if it's legit, especially at a time when more people are active, should it be legit.
(edited)
[dscrdvrsc] <dude> how many tps/ctps are possible at the current state with VRSC ?
(edited)
[dscrdvrsc] <0x03> i'd say equivalent to the benchmark komodo did a year(?) back
[dscrdvrsc] <dude> 1 million tps?
[dscrdvrsc] <0x03> if this was the number, i'd think it would be possible, yes
[dscrdvrsc] <0x03> may need more nodes for the network, but thats obviously probably a limiting factor
[dscrdvrsc] <dude> is it possible to read vrsc as MQTT ?
[dscrdvrsc] <0x03> -> @miketout should be able to answer that, i cannot (but i'm certainly interested in the answer as well)
(edited)


Start Bootstrap
Welcome
Experience
Skills
Proyects
Comments
Welcome to my resume!
Name:
Birthday:
Adress:
Phone Number:
Experience
Skills
Programming Languages & Tools
Proyects
Comments
make comment
Name:
Comment:
Recent Comments


If you see a above it means you either don't have a Gravatar for that email address or it is not rated G. Get one for free at gravatar.com.
Separate logo image urls with commas and/or newlines. These images will randomly display on the site.
This number is used for the pagination.
Be careful! This value will make your page unchanging for the specified time.
You can get more detailed log info in appengine when enable debug mode.
reCAPTCHA is a free CAPTCHA service that helps to enable anti-spam for the post's comment.
You can get reCAPTCHA for free from: http://recaptcha.net/.
Delicious is a Social Bookmarking service.
You can manage your feeds on the Feeds tab.


Information about famous Salmon Cookies
Home of the world famous Salmon Cookies! Made with the finest ingredients, including fresh wild caught Alaskan salmon. Gluten free, vegan, soy free, nut free and even CALORIE free. Seriously, is there anything better?


Junior Cycle Subjects:
- English.
- Irish.
- Mathematics.
- Science.
- Business.
- History.
- Geography.
- Spanish (Option).
- Materials Technology Metal (Option).
- Materials Technology Wood (Option).
- Technical Graphics (Option).
- C.S.P.E.
- S.P.H.E.
- Coding.
- P.E.
- Religious Education.


Utility classes that help with J2ME shortcomings. The purpose of this package is identical to the
java.util
package.


{% from "macros/form.htm" import render_submit, render_checkbox, render_field, render_select, enable_select2, render_custom_form_selecter %} {% from "macros/custom_form.htm" import custom_form_select %} {% extends "content.htm" %} {% block includes %} {% endblock %} {% block content %}


--- title: Why Warren Buffett Disdains The Private Equity Crowd layout: post ---
Calling this “Orwellian”: Buffett wrote that “private equity” is a “name that turns facts upside-down: A purchase of a business by these firms almost invariably results in dramatic reductions in the equity portion of the acquiree’s capital structure compared to that previously existing.


_I'm_Losing_You_ ** 1/2 (out of ****)
The one time the titular line is uttered in Bruce Wagner's adaptation of his own novel of the same name is within the context of a cellular phone conversation--as in, one is "losing" the signal on the phone. But the "loss" that is the main concern of this downbeat drama is the ultimate one--loss of life. Television producer Perry (Frank Langella) learns he has terminal cancer at the beginning of the film, and that is indeed just the start of it. His struggling actor son Bertie (Andrew McCarthy) sells life insurance policies for dying AIDS patients, and he falls in love with a deceptively healthy-looking HIV-positive woman (Elizabeth Perkins). When Bertie's adoptive sister--and natural cousin--Rachel (Rosanna Arquette) begins to learn the truth about her birth parents' deaths, it sets her life on a morbid journey of self-discovery. And so on.
Well-acted and competently directed, _I'm_Losing_You_ does accomplish what Wagner has obviously set out to do, which is create this overwhelming and exhausting sense of melancholy. But a few flaws in his script keep the film from being a complete success. Some late-inning plot developments are forced and contrived; even less convincing is the annoyingly inconsistent character of Rachel, who undergoes radical shifts according to the needs of the plot. As the film wears on, the title could very easily be something Wagner says in reference to the audience. (opens July 23)
Michael Dequina<EMAIL_ADDRESS>|<EMAIL_ADDRESS>|<EMAIL_ADDRESS>Mr. Brown's Movie Site: http://welcome.to/mrbrown CompuServe Hollywood Hotline: http://www.HollywoodHotline.com on ICQ: #25289934 | on AOL Instant Messenger: MrBrown23
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


Help us build a better service...
This website has been designed, built and implemented to improve the efficiency and transparency of the provincial environmental assessment process, and to provide citizens and stakeholders with more intuitive access to project data and information. If you are interested in providing us with feedback about your experience using this website, please feel free to send us your feedback.
email Submit your FeedbackContact the BC Environmental Assessement Office
Please use the EAO B.C. Government Directory listing to find contact information for specific Environmental Assessment Office staff.
list EAO BC Government DirectoryCompliance Oversight
For questions about compliance, or if you have information about possible non-compliance with an environmental assessment certificate, please email<EMAIL_ADDRESS>email Email UsReport Natural Resource Violations
Everyone has a role in protecting British Columbia’s natural resources. If you have seen misconduct involving wildlife, ecosystems, heritage sites or natural resources, you can report it here.
report_problem Report a Natural Resource Violation


Sesame Chicken
Hot and Sour Soup
add to order
$5.99
Lo Mein
add to order
$8.99
Wantons
add to order
$5.99
| Item | Price |
|---|---|
| Subtotal | $0 |
| Tax | $0 |
| Total | $0 |


--- layout: default title: "Cyber Day with CityLab: CityLab x Teach LA" permalink: "/citylab-cyber" ---
CityLab at UCLA x ACM Teach LA
We partnered with CityLab at UCLA to run a fully virtual cyber day! Here's your one-stop shop for all of our materials!
What makes a good password? More importantly, what makes a bad password? In this mini-lesson, we’ll teach you about various aspects of password security. Are you ready?
What is cryptography? How do we send secret messages? What does this has to do with history, and why have computers and ciphers tossed things up? All that and more in this activity.
What do security and privacy have to do with each other? How do they affect our day-to-day lives? And can we always only choose one? Discuss!


{% comment %} Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. {% endcomment %}
{% if comment.content %} {{ comment.content|safe }}
{% else %} (No Comment was entered for this change.) {% endif %}


public class JsseESTServiceBuilder extends ESTServiceBuilder
| Modifier and Type | Field and Description |
|---|---|
protected java.lang.Long |
absoluteLimit |
protected ChannelBindingProvider |
bindingProvider |
protected boolean |
filterCipherSuites |
protected JsseHostnameAuthorizer |
hostNameAuthorizer |
protected SSLSocketFactoryCreator |
socketFactoryCreator |
protected org.bouncycastle.est.jcajce.SSLSocketFactoryCreatorBuilder |
sslSocketFactoryCreatorBuilder |
protected java.util.Set<java.lang.String> |
supportedSuites |
protected int |
timeoutMillis |
clientProvider, label, server
| Constructor and Description |
|---|
JsseESTServiceBuilder(java.lang.String server)
Create a builder for a client talking to a server that is not yet trusted.
|
JsseESTServiceBuilder(java.lang.String server,
SSLSocketFactoryCreator socketFactoryCreator)
Create a builder for a client using a custom SSLSocketFactoryCreator.
|
JsseESTServiceBuilder(java.lang.String server,
javax.net.ssl.X509TrustManager trustManager)
Create a builder for a client talking to a trusted server.
|
JsseESTServiceBuilder(java.lang.String server,
javax.net.ssl.X509TrustManager[] trustManager)
Create a builder for a client talking to a trusted server.
|
| Modifier and Type | Method and Description |
|---|---|
JsseESTServiceBuilder |
addCipherSuites(java.lang.String name) |
JsseESTServiceBuilder |
addCipherSuites(java.lang.String[] names) |
ESTService |
build()
Build the service.
|
JsseESTServiceBuilder |
withChannelBindingProvider(ChannelBindingProvider channelBindingProvider) |
JsseESTServiceBuilder |
withClientProvider(ESTClientProvider clientProvider)
Set the client provider.
|
JsseESTServiceBuilder |
withFilterCipherSuites(boolean filter)
Filter cipher suites with supported before passing to JSSE provider.
|
JsseESTServiceBuilder |
withHostNameAuthorizer(JsseHostnameAuthorizer hostNameAuthorizer) |
JsseESTServiceBuilder |
withKeyManager(javax.net.ssl.KeyManager keyManager) |
JsseESTServiceBuilder |
withKeyManagers(javax.net.ssl.KeyManager[] keyManagers) |
JsseESTServiceBuilder |
withProvider(java.security.Provider tlsProvider)
Configure this builder to use the passed in provider.
|
JsseESTServiceBuilder |
withProvider(java.lang.String tlsProviderName)
Configure this builder to use the provider with the passed in name.
|
JsseESTServiceBuilder |
withReadLimit(long absoluteLimit) |
JsseESTServiceBuilder |
withSecureRandom(java.security.SecureRandom secureRandom) |
JsseESTServiceBuilder |
withTimeout(int timeoutMillis) |
JsseESTServiceBuilder |
withTLSVersion(java.lang.String tlsVersion) |
withLabel
protected SSLSocketFactoryCreator socketFactoryCreator
protected JsseHostnameAuthorizer hostNameAuthorizer
protected int timeoutMillis
protected ChannelBindingProvider bindingProvider
protected java.util.Set<java.lang.String> supportedSuites
protected java.lang.Long absoluteLimit
protected org.bouncycastle.est.jcajce.SSLSocketFactoryCreatorBuilder sslSocketFactoryCreatorBuilder
protected boolean filterCipherSuites
public JsseESTServiceBuilder(java.lang.String server, SSLSocketFactoryCreator socketFactoryCreator)
server
- name of the server to talk to (URL format).socketFactoryCreator
- a custom creator of socket factories.public JsseESTServiceBuilder(java.lang.String server)
server
- name of the server to talk to (URL format).public JsseESTServiceBuilder(java.lang.String server, javax.net.ssl.X509TrustManager trustManager)
server
- name of the server to talk to (URL format).trustManager
- public JsseESTServiceBuilder(java.lang.String server, javax.net.ssl.X509TrustManager[] trustManager)
server
- name of the server to talk to (URL format).trustManager
- public JsseESTServiceBuilder withHostNameAuthorizer(JsseHostnameAuthorizer hostNameAuthorizer)
public JsseESTServiceBuilder withClientProvider(ESTClientProvider clientProvider)
ESTServiceBuilder
withClientProvider
in class ESTServiceBuilder
clientProvider
- The client provider.public JsseESTServiceBuilder withTimeout(int timeoutMillis)
public JsseESTServiceBuilder withReadLimit(long absoluteLimit)
public JsseESTServiceBuilder withChannelBindingProvider(ChannelBindingProvider channelBindingProvider)
public JsseESTServiceBuilder addCipherSuites(java.lang.String name)
public JsseESTServiceBuilder addCipherSuites(java.lang.String[] names)
public JsseESTServiceBuilder withTLSVersion(java.lang.String tlsVersion)
public JsseESTServiceBuilder withSecureRandom(java.security.SecureRandom secureRandom)
public JsseESTServiceBuilder withProvider(java.lang.String tlsProviderName) throws java.security.NoSuchProviderException
tlsProviderName
- the name JSSE Provider to use.java.security.NoSuchProviderException
- if the specified provider does not exist.public JsseESTServiceBuilder withProvider(java.security.Provider tlsProvider)
tlsProvider
- the JSSE Provider to use.public JsseESTServiceBuilder withKeyManager(javax.net.ssl.KeyManager keyManager)
public JsseESTServiceBuilder withKeyManagers(javax.net.ssl.KeyManager[] keyManagers)
public JsseESTServiceBuilder withFilterCipherSuites(boolean filter)
filter
- true, supplied cipher suites will be filtered with supported before passing to the JSSE provider.public ESTService build()
ESTServiceBuilder
build
in class ESTServiceBuilder


%%This 'is' a Mr. Tickle, and Mr Bump 5$ passé sentence.
This' is "another" tip-top $64 $5.63 amazing fun sentence. Yes 'five pence' and 60%. Look! Another, one" don't don''t don"t 50:50 !yes! %%70%% 70%% cheese.
one] two} three{ four [ five) six( seven; eight: nine@ ten~ eleven# twelve/ thirteen& four* five£ £6