# Functions
Creates a new instance of the persistence component.
Creates a new instance of the persistence component.
Creates a new instance of the persistence component.
# Structs
### Configuration parameters ###
- collection: (optional) SQLite collection name - connection(s): - discovery_key: (optional) a key to retrieve the connection from [[https://rawgit.com/pip-services-node/pip-services3-components-node/master/doc/api/interfaces/connect.idiscovery.html IDiscovery]] - host: host name or IP address - port: port number (default: 27017) - uri: resource URI or connection string with all parameters in it - credential(s): - store_key: (optional) a key to retrieve the credentials from [[https://rawgit.com/pip-services-node/pip-services3-components-node/master/doc/api/interfaces/auth.icredentialstore.html ICredentialStore]] - username: (optional) user name - password: (optional) user password - options: - connect_timeout: (optional) number of milliseconds to wait before timing out when connecting a new client (default: 0) - idle_timeout: (optional) number of milliseconds a client must sit idle in the pool and not be checked out (default: 10000) - max_pool_size: (optional) maximum number of clients the pool should contain (default: 10)
### References ###
- \*:logger:\*:\*:1.0 (optional) [[https://rawgit.com/pip-services-node/pip-services3-components-node/master/doc/api/interfaces/log.ilogger.html ILogger]] components to pass log messages components to pass log messages - \*:discovery:\*:\*:1.0 (optional) [[https://rawgit.com/pip-services-node/pip-services3-components-node/master/doc/api/interfaces/connect.idiscovery.html IDiscovery]] services - \*:credential-store:\*:\*:1.0 (optional) Credential stores to resolve credentials
### Example ###
type MySqlitePersistence struct { IdentifiableSqliteJsonPersistence} func NewMySqlitePersistence() * MySqlitePersistence { return &MySqlitePersistence{ IdentifiableSqliteJsonPersistence: NewIdentifiableSqliteJsonPersistence("mydata") }
func (c*MySqlitePersistence)composeFilter(filter *cdata.FilterParams) interface{} { if filter == nil { filter = NewFilterParams(); } let criteria = []; let name = filter.getAsNullableString('name'); if (name != null) criteria.push({ name: name }); return criteria.length > 0 ? { $and: criteria } : null; }
GetPageByFilter(correlationId: string, filter: FilterParams, paging: PagingParams, callback: (err: any, page: DataPage<MyData>) => void): void { base.getPageByFilter(correlationId, c.composeFilter(filter), paging, null, null, callback); }
}
let persistence = new MySqlitePersistence(); persistence.configure(ConfigParams.fromTuples( "host", "localhost", "port", 27017 ));
persitence.open("123", (err) => { ..
Abstract persistence component that stores data in SQLite
and implements a number of CRUD operations over data items with unique ids.
No description provided by the author
# Interfaces
No description provided by the author