{"repo":"H-0-O/spark-orm","free":true,"listed":false,"github":"https://github.com/H-0-O/spark-orm","clone":"git clone https://github.com/H-0-O/spark-orm.git","description":"The MongoDB ORM for Rust","language":"Rust","stars":22,"topics":["mongodb","orm","rust"],"license":null,"category":"databases-storage","readme_excerpt":"Spark-ORM: MongoDB ORM for Rust Spark-ORM is a high-performance, open-source Object-Relational Mapping (ORM) library designed specifically for MongoDB in Rust. It seamlessly bridges Rust structs with MongoDB collections, effortlessly converting structs into models. Features - Derive Models : Effortlessly convert Rust structs into MongoDB models using the Model trait derivation. - Custom Collection Names : Tailor collection names for your models with the #[coll name] attribute. - Memory Efficiency : Built for speed and memory efficiency, Spark-ORM offers a non-heap copy ORM solution for MongoDB. Getting Started 1. Define your model by simply applying the Model attribute and setting the collection name with coll name : 2. Connect to the database in one of two ways: a. Establish a global connection: b. Or connect locally: For the global connection, Spark retains it throughout the program, accessible via: Spark::get db(); Usage Instantiate the model: OR you can use the global connection : if you didn't set global connection , the new model function will panic ---------------------- Update attributes: Save to the database: --- Find a model: --- Update and save: or --- Delete a record: Note: you can use the ? instead of unwrap Model The model trait adds id , timestamps (created at , updated at , deleted at) to your struct and fill automatically Attributes Define index or unique attributes for struct fields: These indexes are registered during the first initiation of Product. The Mo","default_branch":null,"files":null,"tree":[],"storefront":"/r/H-0-O","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/H-0-O/spark-orm/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}