├── .github └── workflows │ └── dispatch-on-release.yml ├── README.md ├── docs ├── SQL_IN_ROW_FILTER.md └── SQL_IN_SQL_CONSOLE.md └── screenshots ├── damaged.png └── top.png /.github/workflows/dispatch-on-release.yml: -------------------------------------------------------------------------------- 1 | name: Dispatch Workflow on Release 2 | 3 | on: 4 | release: 5 | types: [published] 6 | 7 | jobs: 8 | dispatch: 9 | runs-on: ubuntu-latest 10 | steps: 11 | - name: Dispatch workflow in smoothcsv-website 12 | uses: peter-evans/repository-dispatch@v3 13 | with: 14 | token: ${{ secrets.SMOOTHCSV_WEBSITE_DISPATCH_TOKEN }} 15 | repository: kohii/smoothcsv-website 16 | event-type: release-published 17 | client-payload: '{ "release_tag": "${{ github.event.release.tag_name }}", "release_url": "${{ github.event.release.html_url }}" }' 18 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SmoothCSV 3 2 | 3 | SmoothCSV 3 is the next generation of [SmoothCSV](https://github.com/kohii/smoothcsv), featuring a new UI, new functionalities, and updated technologies. 4 | 5 | ![](./screenshots/top.png) 6 | 7 | ## Status 8 | 9 | This project is currently a work in progress. 10 | 11 | The source code is not yet public. 12 | (I have not decided whether it will be open-source.) 13 | 14 | ## Download 15 | 16 | A beta version is available for testing. 17 | You can download it from the [releases](https://github.com/kohii/smoothcsv3/releases) page. 18 | 19 | Please note that the beta version may contain bugs and might not be stable. Use it at your own risk. 20 | 21 | Report any bugs or feature requests via the [issue tracker](https://github.com/kohii/smoothcsv3/issues). 22 | 23 | ## Roadmap 24 | 25 | - [x] Alpha release 26 | - [x] Implement basic functionality (file read/write, editing, undo/redo, copy/paste, find/replace, command palette, etc.) 27 | - [x] Beta release 28 | - [x] Add Windows support 29 | - [x] Rebrand the app 30 | - [x] Add an updater 31 | - [x] Pay $99 for Apple Developer Program 32 | - [x] Localize for Japanese, Spanish, Chinese-Simplified 33 | - [ ] Stable release 34 | - [ ] Implement all features from the original SmoothCSV 35 | - [ ] Add a toolbar 36 | - [x] Build a website 37 | - [x] Implement settings 38 | - [ ] Implement dark mode 39 | - [ ] Launch on Product Hunt 40 | - [ ] Improve performance 41 | - [ ] Enhance stability 42 | - [ ] Add localization for other languages 43 | - [ ] Add Linux support 44 | - [ ] Future plans 45 | - [ ] Develop an extension system 46 | - [ ] Open-source the project 47 | - [ ] Support additional file formats 48 | - [ ] Integrate AI assistance 49 | 50 | I aspire for this app to eventually be considered the "VSCode of tabular editors." 51 | 52 | ## Support ❤️ 53 | 54 | If you like this project and would like to support me, you can help by: 55 | 56 | [!["Buy Me A Coffee"](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://www.buymeacoffee.com/kohii) 57 | 58 | Also, please: 59 | 60 | - Star the repository 61 | - Follow me on X for updates 62 | - en: https://x.com/kohiidev 63 | - ja: https://x.com/kohii00 64 | -------------------------------------------------------------------------------- /docs/SQL_IN_ROW_FILTER.md: -------------------------------------------------------------------------------- 1 | # SQL in Row Filter 2 | 3 | SmoothCSV allows you to filter rows using SQL WHERE clause syntax, providing a powerful way to query your CSV data. 4 | 5 | ## Getting Started 6 | 7 | To access the filter query input: 8 | 9 | - Use keyboard shortcut: `Ctrl+Shift+F` (macOS: `Cmd+Shift+F`) 10 | - Open Command Palette and search for "filter" 11 | - Select `Grid` > `Filter` from the menubar 12 | 13 | ## Query Syntax 14 | 15 | The filter uses SQL WHERE clause syntax with some limitations: 16 | 17 | - Write only the condition part that would follow a WHERE clause 18 | - No subqueries 19 | - No window functions 20 | - No aggregate functions 21 | 22 | ## Referencing Columns 23 | 24 | - Column names can be referenced in two ways: 25 | - Using header row values when a header row is specified 26 | - Use double quotes for names with special characters 27 | - Example: `"First Name" LIKE 'John%'` 28 | - Using default names (`c1`, `c2`, ...) when no header row is present 29 | - Example: `c1 > 1000 AND c2 = 'Active'` 30 | 31 | ## Data Types 32 | 33 | Supported types: 34 | 35 | - `string` (alias: `text`, `varchar`) 36 | - `number` (alias: `double precision`, `float`) 37 | - `boolean` 38 | - `bigint` 39 | - `null` 40 | - `date` 41 | - `time` 42 | - `timestamp` 43 | - `interval` 44 | 45 | Notes: 46 | 47 | - All cell values are initially treated as `string` 48 | - Type coercion follows JavaScript-like rules for primitive types: 49 | - `1 = true` → `true` 50 | - `'1' = 1` → `true` 51 | - `'' = 0` → `true` 52 | - `1 + true` → `2` 53 | - No implicit type coercion is performed for `date`, `time`, `timestamp`, and `interval` types 54 | - Use `CAST` or `TRY_CAST` to convert strings to these types 55 | 56 | Use `CAST` or `TRY_CAST` for explicit type conversion: 57 | 58 | ```sql 59 | CAST('123' AS bigint) -- returns 123 60 | CAST('12.3' AS double precision) -- returns 12.3 61 | CAST('abc' AS bigint) -- error 62 | TRY_CAST('abc' AS bigint) -- returns null 63 | CAST('2024-03-14' AS date) -- returns date 64 | CAST('15:30:00' AS time) -- returns time 65 | CAST('2024-03-14 15:30:00' AS timestamp) -- returns timestamp 66 | ``` 67 | 68 | ### Date/Time/Interval Literal Syntax 69 | 70 | #### Date 71 | 72 | - ISO format: `DATE 'YYYY-MM-DD'` 73 | - Example: `DATE '2024-03-14'` 74 | 75 | #### Time 76 | 77 | - 24-hour format: `TIME 'HH:MM:SS[.fraction]'` 78 | - Example: `TIME '15:30:00'`, `TIME '15:30:00.123'` 79 | 80 | #### Timestamp 81 | 82 | - Combined date and time: `TIMESTAMP 'YYYY-MM-DD HH:MM:SS[.fraction]'` 83 | - Example: `TIMESTAMP '2024-03-14 15:30:00'` 84 | 85 | #### Interval 86 | 87 | - Format: `INTERVAL 'quantity' leading_field [to last_field]` 88 | - Supported units: `year`, `month`, `day`, `hour`, `minute`, `second` 89 | - Example: `INTERVAL '1-2' year to month`, `INTERVAL '1 2:30' day to minute` 90 | 91 | ### Numeric Literal Inference 92 | 93 | - If a numeric literal is all digits and outside the range of `number` type in JavaScript (i.e. `-9007199254740991` to `9007199254740991`), interpret it as `bigint`. 94 | - Otherwise, interpret it as `number`. 95 | 96 | ``` 97 | 123 → number 98 | 12345678901234567890 → bigint 99 | 12345678901234567890.0 → number 100 | ``` 101 | 102 | ## Available Functions 103 | 104 | ### String Functions 105 | 106 | | Function | Description | Example | 107 | |----------|-------------|---------| 108 | | `LENGTH(str)` | String length | `LENGTH(name) > 5` | 109 | | `LOWER(str)` | Convert to lowercase | `LOWER(status) = 'active'` | 110 | | `UPPER(str)` | Convert to uppercase | `UPPER(code) = 'ABC'` | 111 | | `TRIM(str)` | Remove whitespace | `TRIM(description) != ''` | 112 | | `SUBSTRING(str, start[, length])` | Extract substring | `SUBSTRING(name, 1, 3) = 'Joe'` | 113 | | `CONCAT(str1, str2, ...)` | Join strings | `CONCAT(firstName, ' ', lastName)` | 114 | | `REPLACE(str, from, to)` | Replace text | `REPLACE(email, '@old.com', '@new.com')` | 115 | 116 | ### Numeric Functions 117 | 118 | | Function | Description | Example | 119 | |----------|-------------|---------| 120 | | `ABS(num)` | Absolute value | `ABS(balance) > 1000` | 121 | | `CEIL(num)` | Round up | `CEIL(price) = 100` | 122 | | `FLOOR(num)` | Round down | `FLOOR(rating) = 4` | 123 | | `ROUND(num[, precision])` | Round number | `ROUND(amount, 2) = 99.99` | 124 | | `POWER(base, exp)` | Power operation | `POWER(num, 2) > 100` | 125 | | `SQRT(num)` | Square root | `SQRT(area) < 10` | 126 | | `MOD(num, divisor)` | Remainder | `MOD(id, 2) = 0` | 127 | | `TRUNC(num[, precision])` | Truncate decimals | `TRUNC(price, 2)` | 128 | 129 | ### Conditional Functions 130 | 131 | | Function | Description | Example | 132 | |----------|-------------|---------| 133 | | `COALESCE(val1, val2, ...)` | First non-null value | `COALESCE(nickname, name, 'Unknown')` | 134 | | `NULLIF(val1, val2)` | Null if equal | `NULLIF(status, 'N/A')` | 135 | -------------------------------------------------------------------------------- /docs/SQL_IN_SQL_CONSOLE.md: -------------------------------------------------------------------------------- 1 | # SQL Console 2 | 3 | SmoothCSV provides a powerful SQL query interface for CSV files through its SQL Console feature. This feature leverages SQLite as its underlying SQL engine, enabling you to perform complex data analysis directly on your CSV files. 4 | 5 | ## Accessing the SQL Console 6 | 7 | There are three ways to open the SQL Console: 8 | 9 | - Via Command Palette: Search for "SQL console" 10 | - Via Menu Bar: Navigate to `File` > `New SQL Console` 11 | - Via `Open in SQL Console` in the filter widget 12 | 13 | ## Writing SQL Queries 14 | 15 | ### Query Syntax Overview 16 | 17 | The SQL Console supports SQLite's SQL syntax. 18 | 19 | ### Table References 20 | 21 | You can reference your CSV files in queries using the `@` prefix syntax with double quotes: 22 | 23 | ```sql 24 | -- For files with a specific path 25 | SELECT * FROM "@file:/path/to/file.csv"; 26 | 27 | -- For untitled/unsaved files 28 | SELECT * FROM "@untitled:Untitled-1"; 29 | ``` 30 | 31 | The system attempts to locate files in the following order: 32 | 1. Currently opened files in the editor 33 | 2. Files in the specified filesystem path 34 | 35 | ### Column References 36 | 37 | Column names in queries can be specified in two ways: 38 | 39 | 1. When header row is present: 40 | - Use the actual header values 41 | - Enclose names with special characters in double quotes 42 | ```sql 43 | SELECT "First Name", Age FROM "@file:/data.csv" 44 | WHERE "First Name" LIKE 'John%'; 45 | ``` 46 | 47 | 2. When no header row exists: 48 | - Use default column names: `c1`, `c2`, etc. 49 | ```sql 50 | SELECT c1, c2 FROM "@file:/data.csv" 51 | WHERE c1 > 1000; 52 | ``` 53 | 54 | ### Data Type Handling 55 | 56 | SQLite features dynamic typing, which means it can automatically convert between text and numeric values as needed. This makes it very convenient for working with CSV data, as you can use numeric operations directly on numeric-looking text values: 57 | 58 | ```sql 59 | -- Price column contains text values like "1000", "1500", etc. 60 | SELECT 61 | Price * 1.1 AS price_with_tax, 62 | COUNT(*) AS count 63 | FROM "@file:/data.csv" 64 | WHERE Price > 1000 65 | GROUP BY Category; 66 | ``` 67 | -------------------------------------------------------------------------------- /screenshots/damaged.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kohii/smoothcsv3/a470747ec46987b9bcb7e2a774bf4020206e19bb/screenshots/damaged.png -------------------------------------------------------------------------------- /screenshots/top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kohii/smoothcsv3/a470747ec46987b9bcb7e2a774bf4020206e19bb/screenshots/top.png --------------------------------------------------------------------------------