
Security News
Crates.io Users Targeted by Phishing Emails
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
an-expo-sqlite-orm
Advanced tools
npm i an-expo-sqlite-orm
or yarn add an-expo-sqlite-orm
import { SQLiteModel, SQLiteModelSchema } from "an-expo-sqlite-orm";
export interface TodoFields {
title: string;
completed: boolean;
}
export interface TodoSchema {
fields: TodoFields,
children:{},
parents:{}
}
export class TodoModel extends SQLiteModel<TodoSchema> {
tableName = "todo"
getSchema(): SQLiteModelSchema<{ fields: TodoFields; children: {}; parents: {}; }> {
return {
fields:{
title: {type:'TEXT'},
completed: {type: 'BOOLEAN'},
},
children: {},
parents: {},
}
}
}
import { initDatabase, resetDatabase, SQLiteModel } from "an-expo-sqlite-orm";
import { TodoModel } from "./models/todo";
export const models: SQLiteModel<any>[] = [
new TodoModel()
];
export default (() => {
return initDatabase(models);
return resetDatabase(models);
})();
import './db/init'
const todo = new TodoModel()
// todo.objects.[method].run() run is Promise return value depends on [method]
todo.objects.create({
// todo object
}).run().then((newCreateItem)=>{
console.log('item created' , newCreateItem)
})
todo.objects.filter({id:[id:number]}).update({
// todo object
}).run().then((val:SQLite.SQLiteRunResult)=>{
console.log(val)
})
todo.objects.filter({id:[id:number]}).delete().run().then((val:SQLite.SQLiteRunResult)=>{
console.log(val)
})
todo.objects.first().run().the(item=>{
console.log('first item', item)
}).catch(()=>{
// item is not found
})
// in todo getSchema fields add useInSearch:true in any field you want to search
todo.objects.search('hello').run().the(items=>{
console.log('items', items)
})
todo.objects.pagination(1,20).run().the(items=>{
console.log('items of page 1 if pageSize is 20', items)
})
this type is so important if you use any method return that you can update or delete the single instance or get parent or children too
FAQs
`npm i an-expo-sqlite-orm` or `yarn add an-expo-sqlite-orm`
We found that an-expo-sqlite-orm demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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 Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.