Skip to content

Commit a7a7063

Browse files
committed
Merge branch 'main' into table-providers
2 parents a22447d + 10b6e36 commit a7a7063

24 files changed

+487
-271
lines changed

.github/workflows/release.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
workflow_dispatch:
55
push:
66
tags:
7-
- 'lens-v*'
7+
- 'v*'
88
jobs:
99
publish:
1010
permissions:

CHANGELOG.md

+35
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,41 @@
22
All notable changes to this project will be documented in this file. See [conventional commits](https://www.conventionalcommits.org/) for commit guidelines.
33

44
- - -
5+
## [v0.2.2](https://github.com/oktal/lens/compare/664ebef7b2e0489c327b74f5fa427941771f3808..v0.2.2) - 2024-09-25
6+
#### Bug Fixes
7+
- properly display datasources in table creation dialog - ([979d529](https://github.com/oktal/lens/commit/979d5294826b98cef8ef4c611a67be1fa93a725b)) - [@octal](https://github.com/octal)
8+
#### Miscellaneous Chores
9+
- **(version)** version 0.2.2 - ([c631ae3](https://github.com/oktal/lens/commit/c631ae37eb34a671fa6dc475e18c53e35fec8056)) - [@octal](https://github.com/octal)
10+
- **(version)** v0.2.1 - ([664ebef](https://github.com/oktal/lens/commit/664ebef7b2e0489c327b74f5fa427941771f3808)) - [@octal](https://github.com/octal)
11+
12+
- - -
13+
14+
## [v0.2.1](https://github.com/oktal/lens/compare/26f342bc4eea9de2a382d2fa0efe93e4543b90bc..v0.2.1) - 2024-09-25
15+
#### Miscellaneous Chores
16+
- **(CHANGELOG)** remove duplicate entry from CHANGELOG - ([232990c](https://github.com/oktal/lens/commit/232990c5518f856c46116f94d4b38db7a5f8f661)) - [@octal](https://github.com/octal)
17+
#### Refactoring
18+
- **(ui)** minor update of how datasources are displayed - ([26f342b](https://github.com/oktal/lens/commit/26f342bc4eea9de2a382d2fa0efe93e4543b90bc)) - [@octal](https://github.com/octal)
19+
20+
- - -
21+
22+
- - -
23+
## [v0.2.0](https://github.com/oktal/lens/compare/0fdcff7d5a13800a33ca17a777a5b1a2482e63a4..v0.2.0) - 2024-09-23
24+
#### Bug Fixes
25+
- **(ui.sidebar)** open project GitHub when clicking github icon button - ([dd8b3ad](https://github.com/oktal/lens/commit/dd8b3ad372e966ad1d2c6d60cd1e7fb6b92d8372)) - [@octal](https://github.com/octal)
26+
- add google gcs datasource configuration options - ([ea782aa](https://github.com/oktal/lens/commit/ea782aa3ac74d43acabb709a76422ad5738acfd6)) - [@octal](https://github.com/octal)
27+
#### Features
28+
- **(ui)** query title can now be updated from history - ([8053c4b](https://github.com/oktal/lens/commit/8053c4bd3775b1d9e349d77dd7699615248f9519)) - [@octal](https://github.com/octal)
29+
#### Miscellaneous Chores
30+
- **(ci)** update release gh workflow tag prefix - ([fdf6b1e](https://github.com/oktal/lens/commit/fdf6b1ed6cb53f8800104e9c7620454e40036171)) - [@octal](https://github.com/octal)
31+
- **(version)** update version in tauri.conf.json - ([66364f0](https://github.com/oktal/lens/commit/66364f09298b5fdc00ddbb7723b33c2a13d31ea8)) - [@octal](https://github.com/octal)
32+
- **(version)** bump version in Cargo.toml - ([a992442](https://github.com/oktal/lens/commit/a9924427e02e65867835c26948884760e0eac3ed)) - [@octal](https://github.com/octal)
33+
- **(version)** v0.2.0 - ([1f7ba32](https://github.com/oktal/lens/commit/1f7ba32ee1bb9d702011c8f5253ea08f87ea473a)) - [@octal](https://github.com/octal)
34+
- configure tag prefix for cog - ([00f1a89](https://github.com/oktal/lens/commit/00f1a8944a0bbe216fff05014ef088854ff1a72d)) - [@octal](https://github.com/octal)
35+
- make window maximized by default - ([2a9e8a2](https://github.com/oktal/lens/commit/2a9e8a2ef0ee8c6da9341f16a9ded6ef031f5ad3)) - [@octal](https://github.com/octal)
36+
- bump CHANGELOG - ([0fdcff7](https://github.com/oktal/lens/commit/0fdcff7d5a13800a33ca17a777a5b1a2482e63a4)) - [@octal](https://github.com/octal)
37+
38+
- - -
39+
540
## [0.1.0](https://github.com/oktal/lens/compare/881a737c1ae48e89d758d3f8cc43cbe24c3ac41f..0.1.0) - 2024-09-16
641
#### Bug Fixes
742
- **(backend)** properly unespace characters before executing sql query - ([4e52725](https://github.com/oktal/lens/commit/4e52725e5ad08ae795c90c0ec4df3f7c54f9d316)) - [@octal](https://github.com/octal)

cog.toml

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ pre_bump_hooks = []
1010
post_bump_hooks = []
1111
pre_package_bump_hooks = []
1212
post_package_bump_hooks = []
13+
tag_prefix = "v"
1314

1415
[git_hooks]
1516

src-tauri/Cargo.lock

+72-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src-tauri/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "lens"
3-
version = "0.1.0"
3+
version = "0.2.2"
44
description = "An application to run SQL queries on structured files like csv, parquet, json"
55
authors = ["Mathieu Stefani"]
66
license = "MIT"
@@ -17,7 +17,7 @@ tauri-build = { version = "1.5.3", features = [] }
1717
[dependencies]
1818
serde_json = "1.0"
1919
serde = { version = "1.0", features = ["derive"] }
20-
tauri = { version = "1.7.0", features = [ "dialog-save", "system-tray", "dialog-open", "icon-png"] }
20+
tauri = { version = "1.7.0", features = [ "shell-open", "dialog-save", "system-tray", "dialog-open", "icon-png"] }
2121
datafusion = { version = "41.0.0", features = ["serde"] }
2222
anyhow = "1.0.86"
2323
uuid = { version = "1.10.0", features = ["v4", "fast-rng", "serde"] }

src-tauri/src/common.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ pub struct Row {
6262

6363
/// Configuration for an object storage
6464
#[derive(Debug, Clone, Serialize, Deserialize)]
65+
#[serde(tag = "kind", content = "config")]
6566
pub enum ObjectStoreConfig {
6667
#[serde(rename = "s3", rename_all = "camelCase")]
6768
AmazonS3 {
@@ -72,11 +73,12 @@ pub enum ObjectStoreConfig {
7273
region: String,
7374
},
7475

75-
#[serde(rename = "gcp", rename_all = "camelCase")]
76+
#[serde(rename = "gcs", rename_all = "camelCase")]
7677
GoogleCloudStorage {
7778
service_account_path: Option<String>,
7879
service_acccount_key: Option<String>,
7980
application_credentials_path: Option<String>,
81+
bucket: String,
8082
},
8183
}
8284

src-tauri/src/lens.rs

+27-9
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ use std::sync::{Arc, Mutex};
22

33
use anyhow::Context;
44
use datafusion::{
5-
common::{DataFusionError, sql_datafusion_err},
5+
common::{sql_datafusion_err, DataFusionError},
66
logical_expr::{DdlStatement, LogicalPlan},
77
prelude::*,
88
sql::{parser::Statement, sqlparser::parser::ParserError, TableReference},
99
};
10-
use object_store::{aws::AmazonS3Builder, ObjectStore};
10+
use object_store::{aws::AmazonS3Builder, gcp::GoogleCloudStorageBuilder, ObjectStore};
1111
use tokio::sync::mpsc;
1212
use url::Url;
1313

@@ -59,9 +59,10 @@ fn unescape(input: &str) -> datafusion::error::Result<String> {
5959
't' => '\t',
6060
'\\' => '\\',
6161
_ => {
62-
return Err(sql_datafusion_err!(ParserError::TokenizerError(
63-
format!("unsupported escape char: '\\{}'", next_char)
64-
)))
62+
return Err(sql_datafusion_err!(ParserError::TokenizerError(format!(
63+
"unsupported escape char: '\\{}'",
64+
next_char
65+
))))
6566
}
6667
});
6768
}
@@ -214,7 +215,7 @@ impl Lens {
214215
}
215216

216217
fn create_object_store(config: &ObjectStoreConfig) -> LensResult<Arc<dyn ObjectStore>> {
217-
Ok(Arc::new(match config {
218+
Ok(match &config {
218219
ObjectStoreConfig::AmazonS3 {
219220
access_key_id,
220221
secret_access_key,
@@ -235,13 +236,30 @@ impl Lens {
235236
builder = builder.with_bucket_name(bucket);
236237
}
237238

238-
builder.build()?
239+
Arc::new(builder.build()?)
239240
}
240241
ObjectStoreConfig::GoogleCloudStorage {
241242
service_account_path,
242243
service_acccount_key,
243244
application_credentials_path,
244-
} => todo!(),
245-
}))
245+
bucket,
246+
} => {
247+
let mut builder = GoogleCloudStorageBuilder::from_env().with_bucket_name(bucket);
248+
249+
if let Some(service_account_path) = service_account_path {
250+
builder = builder.with_service_account_path(service_account_path);
251+
}
252+
253+
if let Some(service_acccount_key) = service_acccount_key {
254+
builder = builder.with_service_account_key(service_acccount_key);
255+
}
256+
257+
if let Some(application_credentials_path) = application_credentials_path {
258+
builder = builder.with_application_credentials(application_credentials_path);
259+
}
260+
261+
Arc::new(builder.build()?)
262+
}
263+
})
246264
}
247265
}

src-tauri/src/query/memtable.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use datafusion::{
1212
common::{project_schema, Constraints},
1313
datasource::{TableProvider, TableType},
1414
error::{DataFusionError, Result},
15-
execution::{context::SessionState, SendableRecordBatchStream, TaskContext},
15+
execution::{SendableRecordBatchStream, TaskContext},
1616
physical_expr::EquivalenceProperties,
1717
physical_plan::{
1818
memory::MemoryStream, DisplayAs, DisplayFormatType, ExecutionMode, ExecutionPlan,

src-tauri/tauri.conf.json

+6-2
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,17 @@
77
},
88
"package": {
99
"productName": "lens",
10-
"version": "0.1.0"
10+
"version": "0.2.2"
1111
},
1212
"tauri": {
1313
"allowlist": {
1414
"all": false,
1515
"dialog": {
1616
"open": true,
1717
"save": true
18+
},
19+
"shell": {
20+
"open": true
1821
}
1922
},
2023
"bundle": {
@@ -66,7 +69,8 @@
6669
"height": 600,
6770
"resizable": true,
6871
"title": "lens",
69-
"width": 800
72+
"width": 800,
73+
"maximized": true
7074
}
7175
]
7276
}

0 commit comments

Comments
 (0)