-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feature/share-ui
- Loading branch information
Showing
95 changed files
with
10,519 additions
and
119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
**/target/ | ||
**/node_modules/ | ||
**/.astro | ||
crates/web/frontend/pkg | ||
**Dockerfile | ||
docker-compose.yml | ||
|
39 changes: 39 additions & 0 deletions
39
.sqlx/query-00d28a800544f8fffbc2425a8667a50ba321fd66fb9527a14b114b8543c239ea.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
40 changes: 0 additions & 40 deletions
40
.sqlx/query-1f3b991d71b9b471f1e20838335a8020a8e3962f944612f5f6c45465526bc869.json
This file was deleted.
Oops, something went wrong.
72 changes: 72 additions & 0 deletions
72
.sqlx/query-275e9124cd57a634624ca1e95d25d247ae11d35b55a3a0f20929b5a45199420c.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
17 changes: 0 additions & 17 deletions
17
.sqlx/query-5182ce15cba8d1cbe9e23a84fc10ea18c8b27e59d5423ec93e564f4fe57e55fc.json
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
# If there is a .env file located at `crates/server/.env`, it will be loaded automatically | ||
set dotenv-load | ||
|
||
# https://github.com/launchbadge/sqlx/blob/main/sqlx-cli/README.md | ||
# The DATABASE_URL env var must be set to run those commands | ||
# If there is a .env file located at `crates/server/.env`, it will be loaded automatically | ||
prepare-check: | ||
cargo sqlx prepare --check --workspace | ||
prepare: # To be able to build the project in offline mode | ||
cargo sqlx prepare --workspace | ||
migrate: | ||
cargo sqlx migrate run | ||
run: | ||
cargo run -p gq-server |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,10 @@ | ||
-- Add migration script here | ||
CREATE TYPE data_type AS ENUM('json', 'yaml'); | ||
|
||
CREATE TABLE share ( | ||
id UUID PRIMARY KEY, | ||
json text NOT NULL, | ||
input_data text NOT NULL, | ||
input_type data_type NOT NULL, | ||
output_type data_type NOT NULL, | ||
query text NOT NULL, | ||
expires_at TIMESTAMPTZ NOT NULL | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
pub mod dtos; | ||
pub mod routes; |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
use serde::{Deserialize, Serialize}; | ||
use uuid::Uuid; | ||
|
||
use crate::model::share::{DataType, Share}; | ||
|
||
#[derive(Debug, Serialize, Deserialize)] | ||
#[serde(rename_all = "camelCase")] | ||
pub struct ShareDTO { | ||
pub id: Uuid, | ||
pub input_data: String, | ||
pub input_type: DataTypeDTO, | ||
pub output_type: DataTypeDTO, | ||
pub query: String, | ||
} | ||
|
||
impl From<Share> for ShareDTO { | ||
fn from(share: Share) -> Self { | ||
Self { | ||
id: share.id, | ||
input_data: share.input_data, | ||
input_type: share.input_type.into(), | ||
output_type: share.output_type.into(), | ||
query: share.query, | ||
} | ||
} | ||
} | ||
|
||
#[derive(Debug, Serialize, Deserialize)] | ||
#[serde(rename_all = "SCREAMING_SNAKE_CASE")] | ||
pub enum DataTypeDTO { | ||
Json, | ||
Yaml, | ||
} | ||
|
||
impl From<DataType> for DataTypeDTO { | ||
fn from(data_type: DataType) -> Self { | ||
match data_type { | ||
DataType::Json => Self::Json, | ||
DataType::Yaml => Self::Yaml, | ||
} | ||
} | ||
} | ||
|
||
impl From<DataTypeDTO> for DataType { | ||
fn from(data_type: DataTypeDTO) -> Self { | ||
match data_type { | ||
DataTypeDTO::Json => Self::Json, | ||
DataTypeDTO::Yaml => Self::Yaml, | ||
} | ||
} | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,13 @@ | ||
use app_state::AppState; | ||
use axum::Router; | ||
use sqlx::PgPool; | ||
use state::AppState; | ||
|
||
pub mod dtos; | ||
pub mod api; | ||
pub mod app_state; | ||
pub mod model; | ||
pub mod routes; | ||
pub mod services; | ||
pub mod state; | ||
|
||
pub fn app(db_connection: PgPool, max_share_expiration_time_secs: i64) -> Router { | ||
let app_state = AppState::new(db_connection, max_share_expiration_time_secs); | ||
routes::router(app_state) | ||
api::routes::router(app_state) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.