This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RUST_LOG=debug flutter_rust_bridge_codegen generate | |
[2024-09-20T05:19:53.543Z DEBUG /Users/user1/.cargo/registry/src/index.crates.io-6f17d22bba15001f/flutter_rust_bridge_codegen-2.4.0/src/main.rs:24] cli=Cli { verbose: false, command: Generate(GenerateCommandArgs { watch: false, primary: GenerateCommandArgsPrimary { config_file: None, rust_input: None, dart_output: None, c_output: None, duplicated_c_output: None, rust_root: None, rust_output: None, dart_entrypoint_class_name: None, dart_format_line_length: None, dart_preamble: None, rust_preamble: None, no_dart_enums_style: false, no_add_mod_to_lib: false, llvm_path: None, llvm_compiler_opts: None, dart_root: None, no_build_runner: false, extra_headers: None, no_web: false, no_deps_check: false, default_external_library_loader_web_prefix: None, no_dart3: false, full_dep: false, local: false, enable_lifetime: false, type_64bit_int: false, no_default_dart_async: false, stop_on_error: false, dump: None, dump_all: false } }) } | |
[2024-09-20T05:19:53.545Z DEBUG /Us |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Path buildSubmarinePath(Size size) { | |
return Path() | |
..moveTo(size.width * 0.1950342, size.height * 7.270667) | |
..lineTo(size.width * 0.1646269, size.height * 7.270667) | |
..lineTo(size.width * 0.1646269, size.height * 7.041185) | |
..lineTo(size.width * 0.1604670, size.height * 7.041185) | |
..cubicTo( | |
size.width * 0.1576797, | |
size.height * 7.152261, | |
size.width * 0.1548923, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<dependency> | |
<groupId>org.dizitart</groupId> | |
<artifactId>nitrite</artifactId> | |
<version>1.0</version> | |
</dependency> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
compile 'org.dizitart:nitrite:1.0' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Nitrite db = Nitrite.builder() | |
.compressed() | |
.filePath("/tmp/test.db") | |
.openOrCreate("user", "password"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create a Nitrite Collection | |
NitriteCollection collection = db.getCollection("test"); | |
// Create an Object Repository | |
ObjectRepository<Employee> repository = db.getRepository(Employee.class); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// create a document to populate data | |
Document doc = createDocument("firstName", "John") | |
.put("lastName", "Doe") | |
.put("birthDay", new Date()) | |
.put("data", new byte[] {1, 2, 3}) | |
.put("fruits", new ArrayList<String>() {{ add("apple"); add("orange"); add("banana"); }}) | |
.put("note", "a quick brown fox jump over the lazy dog"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// insert the document | |
collection.insert(doc); | |
// update the document | |
collection.update(eq("firstName", "John"), createDocument("lastName", "Wick")); | |
// remove the document | |
collection.remove(doc); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Cursor cursor = collection.find( | |
// and clause | |
and( | |
// firstName == John | |
eq("firstName", "John"), | |
// elements of data array is less than 4 | |
elemMatch("data", lt("$", 4)), | |
// elements of fruits list has one element matching orange | |
elemMatch("fruits", regex("$", "orange")), | |
// note field contains string 'quick' using full-text index |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// connect to a DataGate server localhost 9090 port | |
DataGateClient dataGateClient = new DataGateClient("http://localhost:9090") | |
.withAuth("userId", "password"); | |
DataGateSyncTemplate syncTemplate | |
= new DataGateSyncTemplate(dataGateClient, "remote-collection@userId"); | |
// create sync handle | |
SyncHandle syncHandle = Replicator.of(db) | |
.forLocal(collection) | |
// a DataGate sync template implementation | |
.withSyncTemplate(syncTemplate) |
NewerOlder