mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) Migrate import code from data engine to Node
Summary: Finishing imports now occurs in Node instead of the data engine, which makes it possible to import into on-demand tables. Merging code was also refactored and now uses a SQL query to diff source and destination tables in order to determine what to update or add. Also fixes a bug where incremental imports involving Excel files with multiple sheets would fail due to the UI not serializing merge options correctly. Test Plan: Browser tests. Reviewers: jarek Reviewed By: jarek Differential Revision: https://phab.getgrist.com/D3046
This commit is contained in:
@@ -56,8 +56,14 @@ export interface ImportTableResult {
|
||||
destTableId: string|null;
|
||||
}
|
||||
|
||||
export interface MergeStrategy {
|
||||
type: 'replace-with-nonblank-source' | 'replace-all-fields' | 'replace-blank-fields-only';
|
||||
export interface ImportOptions {
|
||||
parseOptions?: ParseOptions; // Options for parsing the source file.
|
||||
mergeOptionMaps?: MergeOptionsMap[]; // Options for merging fields, indexed by uploadFileIndex.
|
||||
}
|
||||
|
||||
export interface MergeOptionsMap {
|
||||
// Map of original GristTable name of imported table to its merge options, if any.
|
||||
[origTableName: string]: MergeOptions|undefined;
|
||||
}
|
||||
|
||||
export interface MergeOptions {
|
||||
@@ -65,9 +71,8 @@ export interface MergeOptions {
|
||||
mergeStrategy: MergeStrategy; // Determines how matched records should be merged between 2 tables.
|
||||
}
|
||||
|
||||
export interface ImportOptions {
|
||||
parseOptions?: ParseOptions; // Options for parsing the source file.
|
||||
mergeOptions?: Array<MergeOptions|null>; // Options for merging fields, indexed by uploadFileIndex.
|
||||
export interface MergeStrategy {
|
||||
type: 'replace-with-nonblank-source' | 'replace-all-fields' | 'replace-blank-fields-only';
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user