feat(cli): migrate CLI to native Rust binary
This commit is contained in:
1 parent
fa5579a3f1
commit
4bcf618162
47 files changed
+2369
-1255
No files matched your search
@@ -446,6 +446,7 @@ export const mongoDropDatabase = forward("mongoDropDatabase");
|
||||
export const mongoDropCollection = forward("mongoDropCollection");
|
||||
export const documentFindDocuments = forward("documentFindDocuments");
|
||||
export const mongoFindDocuments = forward("mongoFindDocuments");
|
||||
export const mongoParseShellCommand = forward("mongoParseShellCommand");
|
||||
export const mongoFindOne = forward("mongoFindOne");
|
||||
export const mongoCountDocuments = forward("mongoCountDocuments");
|
||||
export const mongoServerVersion = forward("mongoServerVersion");
|
||||
|
||||
@@ -37,6 +37,7 @@ import type {
|
||||
SshConfigHostEntry,
|
||||
TunnelProfile,
|
||||
} from "@/types/database";
|
||||
import { normalizeRustMongoCommand, type MongoCommand } from "@/lib/mongo/mongoShellCommand";
|
||||
import type { CollectionInfo } from "@/types/database";
|
||||
import type { SchemaDiffPreparation, SchemaDiffPreparationOptions, TableDiff, FunctionDiff, SequenceDiff, RuleDiff, OwnerDiff } from "@/lib/schema/schemaDiff";
|
||||
import type { SidebarObjectKind } from "@/lib/database/databaseObjectCapabilities";
|
||||
@@ -2071,6 +2072,11 @@ export async function mongoFindDocuments(connectionId: string, database: string,
|
||||
return documentFindDocuments(connectionId, database, collection, skip, limit, filter, projection, sort, executionId);
|
||||
}
|
||||
|
||||
export async function mongoParseShellCommand(source: string): Promise<MongoCommand> {
|
||||
const raw = await post<Record<string, unknown>>("/api/mongo/parse-shell-command", { source });
|
||||
return normalizeRustMongoCommand(raw);
|
||||
}
|
||||
|
||||
export async function mongoFindOne(connectionId: string, database: string, collection: string, filter?: string, projection?: string, options?: string, executionId?: string): Promise<MongoDocumentResult> {
|
||||
return post("/api/mongo/find-one", { connectionId, database, collection, filter, projection, options, executionId });
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { invoke } from "@tauri-apps/api/core";
|
||||
import { listen, type UnlistenFn } from "@tauri-apps/api/event";
|
||||
import { normalizeRustMongoCommand, type MongoCommand } from "@/lib/mongo/mongoShellCommand";
|
||||
import type {
|
||||
ConnectionConfig,
|
||||
ConnectionTestResult,
|
||||
@@ -1858,6 +1859,11 @@ export async function mongoFindOne(connectionId: string, database: string, colle
|
||||
return invoke("mongo_find_one", { connectionId, database, collection, filter, projection, options, executionId });
|
||||
}
|
||||
|
||||
export async function mongoParseShellCommand(source: string): Promise<MongoCommand> {
|
||||
const raw = await invoke<Record<string, unknown>>("mongo_parse_shell_command", { source });
|
||||
return normalizeRustMongoCommand(raw);
|
||||
}
|
||||
|
||||
export async function documentFindDocuments(connectionId: string, database: string, collection: string, skip: number, limit: number, filter?: string, projection?: string, sort?: string, executionId?: string): Promise<MongoDocumentResult> {
|
||||
return invoke("document_find_documents", { connectionId, database, collection, skip, limit, filter, projection, sort, executionId });
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user