Flutter के लिए एक स्विफ्ट-प्रभावित स्थायी डेटा प्रबंधन समाधान। अपने ऐप मॉडल को स्थायी रूप से संग्रहीत करने का सरल, शक्तिशाली और प्रकार-सुरक्षित तरीका प्रदान करता है, जिसमें स्वचालित UI अपडेट भी शामिल है।
सार्वजनिक जानकारी से बना चयन मार्गदर्शन। केवल संदर्भ हेतु।
Cozy Data एक Flutter पैकेज है जो Swift के डेटा प्रबंधन दृष्टिकोण से प्रेरित है, जो SQL का उपयोग करके ऐप मॉडल को स्थायी रूप से संग्रहीत करने का एक प्रकार-सुरक्षित और स्पष्ट तरीका प्रदान करता है। यह स्वचालित रूप से डेटाबेस ऑपरेशन का प्रबंधन करता है और डेटा में परिवर्तन होने पर UI अपडेट ट्रिगर करता है, जिससे बॉइलरप्लेट कम होता है और विकास गति बढ़ती है। सरलता और विश्वसनीयता के लिए डिज़ाइन किया गया, यह Flutter के प्रतिक्रियाशील फ्रेमवर्क के साथ बिना किसी दिक्कत के एकीकृत होता है, जिससे यह वास्तविक समय में UI सिंक्रनाइज़ेशन के साथ स्थायी भंडारण की आवश्यकता वाले ऐप्स के लिए आदर्श है।
उपयोग
ऑफलाइन-प्रथम मोबाइल एप्लिकेशन्स
रियल-टाइम डेटा सिंक्रनाइज़ेशन
प्रकार सुरक्षित मॉडल पर्सिस्टेंस
डायनामिक फॉर्म और सूची राज्य प्रबंधन
एप्प सेटिंग्स और उपयोगकर्ता प्राथमिकताओं का भंडारण
मुख्य विशेषताएँ
डेटा बदलाव पर स्वचालित UI अपडेट
प्रकार सुरक्षित डेटा मॉडलिंग
स्विफ्ट-प्रेरित सिंटैक्स और डिज़ाइन
निर्मित क्रूड संचालन
Flutter विजेट्स के साथ निरंतर एकीकरण
इनके लिए उपयुक्त
सरल पर्सिस्टेंस की तलाश में फ्लटर विकासकर्मी
ऑफलाइन क्षमता की आवश्यकता वाले ऐप्स
कोड सुरक्षा और रखरखाव पर ध्यान केंद्रित टीमें
अक्सर डेटा मॉडल परिवर्तन वाले प्रोजेक्ट
Swift या समान घोषणात्मक पैटर्न के साथ विकासकर्ता
विचार योग्य बातें
SQL-आधारित स्टोरेज के लिए सीमित
मूल डेटाबेस अवधारणाओं की समझ की आवश्यकता होती है
बहुत सरल उपयोग केस के लिए ओवरहेड शामिल कर सकता है
अनिर्दिष्ट या बड़े पैमाने पर NoSQL की आवश्यकताओं के लिए उपयुक्त नहीं
मूल README
संबंधित सोर्स रिपॉज़िटरी के मूल README का स्नैपशॉट। नवीनतम सामग्री के लिए रिपॉज़िटरी देखें।
A Swift-inspired persistent data management solution for Flutter. CozyData provides a simple, powerful, and type-safe way to persist your app's models and automatically update your UI when data changes.
final recipe = awaitCozyData.fetcById<Recipe>(persistentModelID: id);
Advanced Usage
The CozyQueryBuilder is a class used to construct complex SQL-like queries in a structured and programmatic way. It allows you to specify various components of a query, such as fields to group by, order by, having clauses, joins, limits, offsets, selected fields, subqueries, table aliases, and where conditions.
final customBuilder = CozyQueryBuilder(
// groupByFields: A list of fields by which the results should be grouped. In this case, it's an empty list, meaning no grouping is applied.
groupByFields: [],
// orderByFields: A list of fields by which the results should be ordered. It's also an empty list here, so no specific ordering is applied.
orderByFields: [],
// Conditions that filter the groups created by the groupBy clause. It's empty, indicating no such conditions.
havingClauses: [],
// joins: A list of join operations to combine rows from two or more tables based on a related column. No joins are specified here
joins: [],
// limit: The maximum number of records to return. Here, it's set to 10.
limit: 10,
// offset: The number of records to skip before starting to return records. It's set to 0, meaning no records are skipped.
offset: 0,
// selectFields: A list of fields to be selected in the query. It's empty, meaning all fields are selected
selectFields: [],
// subqueries: A list of subqueries to be included in the main query. It's empty, indicating no subqueries.
subqueries: [],
// tableAliases: A map of table aliases to be used in the query. It's an empty map here.
tableAliases: {},
// whereGroups: A list of conditions to filter the results. It's empty, meaning no filtering conditions are applied.
whereGroups: [],
);
Sorting and Filtering once
final recipes = awaitCozyData.fetch<Recipe>(customBuilder: customBuilder);
The CozyQueryController manages query operations for a CozyQueryListener. It allows adding where conditions, joins, order by fields, and custom queries to the listener.