
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
sqlite-websql-orm
Advanced tools
An orm for both sqlite and websql usable in Angular 2+ and Ionic 2+. [Follow us On Github](https://github.com/blixit/sqlite-websql-orm)
An orm for both sqlite and websql usable in Angular 2+ and Ionic 2+. Follow us On Github
npm i sqlite-websql-orm
:construction: This package is being updated to be compatible with angular 6. By the way many optimisations are done to improve the conceptual idea.
npm i sqlite-websql-orm@0.2.2npm i sqlite-websql-orm@1.2.1:warning: You will probably need to install manually some peer dependencies.
If you get an issue please look first to the know issue or add an issue to our repository. docs/issues.md.
// under vervion 0.2.2
imports: [
// ...,
OrmModule.init({
name: 'my_custom_database.db',
location: 'default',
options: {
useFakeDatabase: true,
webname: 'my_custom_database',
description: 'SQLite/WebSQL database for browser',
version: '1.0',
maxsize: 2 * 1024 * 1024
}
})
],
// above vervion 1.0.0, replace useFakeDatabase by adapter
import { SqliteWebsqlOrmModule, SchemaFactory, Manager, ADAPTERS } from 'sqlite-websql-orm';
imports: [
// ...,
SqliteWebsqlOrmModule.init({
name: 'my_custom_database.db',
location: 'default',
options: {
adapter: ADAPTERS.auto,
webname: 'my_custom_database',
description: 'SQLite/WebSQL database for browser',
version: '1.0',
maxsize: 2 * 1024 * 1024
}
})
],
RepositoryStore.getSchemaSources() anymore// under vervion 0.2.2
export class AppModule {
constructor(
private schema: SchemaFactory,
private platform: Platform,
) {
if ( this.platform.is('mobile') ) {
this.platform.ready().then(() => {
this.generateSchema();
}).catch(() => {
console.log('mobile platform is not ready');
});
} else {
this.generateSchema();
}
}
generateSchema() {
this.schema.generateSchema(RepositoryStore.getSchemaSources()) // <-- here
.then((db) => {
console.log('Succeed to create the database');
this.eventService.publish(EVENTS.database_schema_create);
}).catch(() => {
console.log('Failed to create the database');
this.eventService.publish(EVENTS.database_schema_failure);
});
}
}
// above vervion 1.0.0, generateSchema doesnt take parameters anymore
generateSchema() {
this.schema.generateSchema() // <-- here
.then(async (connectionHandler) => {
console.log('Succeed to create the database');
this.events.publish('create');
}).catch(() => {
console.log('Failed to create the database');
this.events.publish('failure');
});
}
mapArrayToObject() is not mandatory anymore.@Injectable()
@Repository(Personne)
export class PersonneRepository extends EntityRepository {
constructor(public manager: Manager) {
super(manager);
}
/**
* In versions above 1.0.0,
* this functions overrides the internal one.
*/
mapArrayToObject(array: any): Personne {
const personne: Personne = new Personne();
personne.id = array.id;
personne.name = array.name;
return personne;
}
}
The internal function looks like the function below. An instance of the class managed by the repository is created and all the fields are copied from the database array to the instance.
mapArrayToObject(array: Array<any>): EntityInterface {
const instance = new (this.getClassToken());
const schema = this.getSchema();
for (const key in schema) {
if (key) {
const fieldMetadata = schema[key];
instance[fieldMetadata.propertyKey] = array[fieldMetadata.name];
}
}
return instance;
}
FAQs
An orm for both sqlite and websql usable in Angular 2+ and Ionic 2+. [Follow us On Github](https://github.com/blixit/sqlite-websql-orm)
We found that sqlite-websql-orm demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.