-
Notifications
You must be signed in to change notification settings - Fork 156
Support Airtable API #461
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Support Airtable API #461
Conversation
|
I see Kepano added me as a reviewer, but based on the description I will hold off until I hear from Xheldon saying that it's ready. Looking forward to trying it out! |
|
I think I’ve finally finished this task, the code is ready for review! @tgrosinger I tested importing the Base that @kepano shared with me, which contains multiple tables with nearly 3,000 records, and it runs perfectly😎 |
|
It looks like, due to my mistake, I mixed in dirty history. After cherry-picking all necessary changes, I resubmitted a new version. |
Refer to the Notion API workflow to implement basic interfaces such as a directory tree (Base/Table) selection.
Refer to the CSV import workflow and display the field template configuration interface.
* Add incremental import toggle * Add Base link field setting * Cache certain API requests * Make the Note location setting in CSV templates configurable (since we’ve already created folders by Base/Table)
Considering that Airtable’s API offers only a few request types (listing bases, fetching a table schema, retrieving view records), I split the import process into two parts: process the data first, then write it to files. The import process is now divided into two stages: Stage 1: Retrieve the records of all tables in all bases, along with the corresponding view data, and build the correct content, references, formulas, etc. Stage 2: Write the files, including all view information into a .base file (checking for existing files before writing). Note that any error in Stage 1 will abort the import.
The complete set of formulas supported by Airtable and examples can be found at: https://airtable.com/appCHsByjT6czDeJu/shrHgArBZ61sNOtKl/tblkwFqAgvq4M5tp6/viwAD5P14cSxKntDm?blocks=hide
Properly handle attribute conversion Properly handle formula conversion (WIP)
* The field order now matches the order of fields in Airtable * Check the Text function conversion logic one by one to ensure it is correct.
* Correctly handle rename logic * Handle illegal string filename logic * Correctly handle error flow * Proper handling `=` the differences between Airtable and Obsidian
Ready to test the all formula!
* remove legacy parameters * Use the same directory tree style class names as the Notion API
* Remove unused functions * Remove unused parameters * Extract function parameters of five or more into types * Special handling for Currency and Rating types * Handle type issues
issue #455
This PR’s initial submission only implements the basic functionality; formula, Rollup, Lookup, and other related properties have not been properly handled yet. These features will be fixed in later code commits.
If anyone is willing to try this PR, please be sure to back up your Vault.
Some of the code was generated by AI. I have reviewed and tested it myself, but there are parts that need refactoring. I will continue to optimize the code in subsequent commits and will request the author’s review when the timing feels right.