GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — General Refactor (#72) · zerodaycode/Canyon-SQL@71c7951

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • .DS_Store
  • .github/workflows
    • code-coverage.yml
    • code-quality.yml
    • continuous-integration.yml
    • release.yml
  • .gitignore
  • .vscode
    • settings.json
  • Cargo.toml
  • README.md
  • bash_aliases.sh
  • canyon_connection/src
    • canyon_database_connector.rs
    • datasources.rs
    • lib.rs
  • canyon_core
    • Cargo.toml
    • src
      • canyon.rs
      • column.rs
      • connection
        • clients
          • mod.rs
          • mssql.rs
          • mysql.rs
          • postgresql.rs
        • conn_errors.rs
        • contracts
          • mod.rs
        • database_type.rs
        • datasources.rs
        • db_connector.rs
        • impl_db_connection_macro.rs
        • mod.rs
      • lib.rs
      • mapper.rs
      • query
        • bounds.rs
        • mod.rs
        • operators.rs
        • parameters.rs
        • query.rs
        • querybuilder
          • contracts
            • mod.rs
          • mod.rs
          • syntax
            • ast
              • delete.rs
              • insert.rs
              • mod.rs
              • select.rs
              • update.rs
            • clause.rs
            • column.rs
            • dialect.rs
            • emitter
              • backends
                • mod.rs
                • mssql.rs
                • mysql.rs
                • pg.rs
              • mod.rs
              • types
                • delete.rs
                • helpers.rs
                • insert.rs
                • mod.rs
                • select.rs
                • update.rs
            • having.rs
            • join.rs
            • keyword.rs
            • mod.rs
            • order.rs
            • query_kind.rs
            • symbol.rs
            • table_metadata.rs
            • tokens.rs
            • writer.rs
          • types
            • delete.rs
            • insert.rs
            • mod.rs
            • select.rs
            • update.rs
      • row.rs
      • rows.rs
      • transaction.rs
  • canyon_crud
    • Cargo.toml
    • src
      • bounds.rs
      • crud.rs
      • entity.rs
      • lib.rs
      • mapper.rs
      • query_elements
        • mod.rs
        • operators.rs
        • query.rs
        • query_builder.rs
      • rows.rs
  • canyon_entities
    • Cargo.toml
    • src
      • entity.rs
      • field_annotation.rs
      • helpers.rs
      • lib.rs
      • manager_builder.rs
  • canyon_macros
    • Cargo.toml
    • src
      • canyon_entity_macro.rs
      • canyon_macro.rs
      • canyon_mapper_macro.rs
      • canyon_tokio_test.rs
      • foreignkeyable_macro.rs
      • lib.rs
      • query_operations
        • consts.rs
        • delete.rs
        • delete
          • entity.rs
          • method.rs
          • mod.rs
          • querybuilder.rs
        • doc_comments.rs
        • insert.rs
        • insert
          • entity.rs
          • method.rs
          • mod.rs
        • mod.rs
        • read
          • count.rs
          • find_all.rs
          • find_by_primary_key.rs
          • foreign_key.rs
          • mod.rs
          • select_querybuilder.rs
        • select.rs
        • update.rs
        • update
          • entity.rs
          • method.rs
          • mod.rs
          • querybuilder.rs
      • utils
        • canyon_crud_attribute.rs
        • function_parser.rs
        • helpers.rs
        • macro_tokens.rs
        • mod.rs
        • primary_key_attribute.rs
  • canyon_migrations
    • Cargo.toml
    • src
      • constants.rs
      • lib.rs
      • migrations
        • handler.rs
        • information_schema.rs
        • memory.rs
        • processor.rs
  • docker
    • docker-compose.yml
  • octocat.png
  • src
    • lib.rs
  • tests
    • Cargo.toml
    • canyon_integration_tests.rs
    • crud
      • delete_operations.rs
      • foreign_key_operations.rs
      • hex_arch_example.rs
      • init_mssql.rs
      • insert_operations.rs
      • mod.rs
      • querybuilder_operations.rs
      • read_operations.rs
      • update_operations.rs
    • migrations
      • mod.rs
    • simple_canyon.toml
    • tests_models
      • league.rs
      • player.rs

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Dismiss banner
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎.DS_Store‎

Copy file name to clipboard
8 KB
Binary file not shown.
Collapse file

‎.github/workflows/code-coverage.yml‎

Copy file name to clipboardExpand all lines: .github/workflows/code-coverage.yml
-5Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,6 @@ jobs:
2525
run: |
2626
rustup toolchain install nightly
2727
rustup override set nightly
28-
29-
- name: Make the USER own the working directory. Installing `gssapi` headers
30-
run: |
31-
sudo chown -R $USER:$USER ${{ github.workspace }}
32-
sudo apt -y install gcc libgssapi-krb5-2 libkrb5-dev libsasl2-modules-gssapi-mit
3328
3429
- name: Caching cargo dependencies
3530
id: project-cache
Collapse file

‎.github/workflows/code-quality.yml‎

Copy file name to clipboardExpand all lines: .github/workflows/code-quality.yml
+3-18Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: Code quality and sanity
22

33
on:
44
push:
5-
branches: '*'
5+
branches: [main, dev, develop]
66
pull_request:
7-
branches: '*'
7+
branches: [main, dev, develop]
88

99
jobs:
1010
clippy:
@@ -15,11 +15,6 @@ jobs:
1515
steps:
1616
- uses: actions/checkout@v3
1717

18-
- name: Make the USER own the working directory. Installing `gssapi` headers
19-
run: |
20-
sudo chown -R $USER:$USER ${{ github.workspace }}
21-
sudo apt -y install gcc libgssapi-krb5-2 libkrb5-dev libsasl2-modules-gssapi-mit
22-
2318
- name: Caching project dependencies
2419
id: project-cache
2520
uses: Swatinem/rust-cache@v2
@@ -35,11 +30,6 @@ jobs:
3530
steps:
3631
- uses: actions/checkout@v3
3732

38-
- name: Make the USER own the working directory. Installing `gssapi` headers
39-
run: |
40-
sudo chown -R $USER:$USER ${{ github.workspace }}
41-
sudo apt -y install gcc libgssapi-krb5-2 libkrb5-dev libsasl2-modules-gssapi-mit
42-
4333
- name: Caching project dependencies
4434
id: project-cache
4535
uses: Swatinem/rust-cache@v2
@@ -56,15 +46,10 @@ jobs:
5646
strategy:
5747
fail-fast: false
5848
matrix:
59-
crate: [canyon_connection, canyon_crud, canyon_macros, canyon_migrations]
49+
crate: [canyon_core, canyon_crud, canyon_macros, canyon_entities, canyon_migrations]
6050
steps:
6151
- uses: actions/checkout@v3
6252

63-
- name: Make the USER own the working directory. Installing `gssapi` headers
64-
run: |
65-
sudo chown -R $USER:$USER ${{ github.workspace }}
66-
sudo apt -y install gcc libgssapi-krb5-2 libkrb5-dev libsasl2-modules-gssapi-mit
67-
6853
- name: Caching project dependencies
6954
id: project-cache
7055
uses: Swatinem/rust-cache@v2
Collapse file

‎.github/workflows/continuous-integration.yml‎

Copy file name to clipboardExpand all lines: .github/workflows/continuous-integration.yml
+1-7Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,11 @@ jobs:
2323
- { rust: stable, os: windows-latest }
2424

2525
steps:
26-
- name: Make the USER own the working directory. Installing required build dependencies
27-
if: ${{ matrix.os == 'ubuntu-latest' }}
28-
run: |
29-
sudo chown -R $USER:$USER ${{ github.workspace }}
30-
sudo apt -y install gcc libgssapi-krb5-2 libkrb5-dev libsasl2-modules-gssapi-mit docker-compose
31-
3226
- uses: actions/checkout@v3
3327

3428
- name: docker-compose
3529
if: ${{ matrix.os == 'ubuntu-latest' }}
36-
run: docker-compose -f ./docker/docker-compose.yml up -d
30+
run: docker compose -f ./docker/docker-compose.yml up -d
3731

3832
- name: Caching cargo dependencies
3933
id: project-cache
Collapse file

‎.github/workflows/release.yml‎

Copy file name to clipboardExpand all lines: .github/workflows/release.yml
+1-6Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Generate Canyon-SQL release
22

33
on:
44
push:
5-
tags:
5+
tags:
66
- 'v[0-9]+.[0-9]+.[0-9]+'
77
- 'v[0-9]+.[0-9]+.[0-9]+rc[0-9]+'
88

@@ -14,11 +14,6 @@ jobs:
1414
- name: Checkout sources
1515
uses: actions/checkout@v3
1616

17-
- name: Installing `docker-compose`
18-
run: sudo apt -y install docker-compose
19-
- name: Installing `gssapi` headers
20-
run: sudo apt -y install gcc libgssapi-krb5-2 libkrb5-dev libsasl2-modules-gssapi-mit
21-
2217
- name: Install stable toolchain
2318
uses: actions-rs/toolchain@v1
2419
with:
Collapse file

‎.gitignore‎

Copy file name to clipboardExpand all lines: .gitignore
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,5 @@ Cargo.lock
44
/tester_canyon_sql/
55
canyon_tester/
66
macro_utils.rs
7-
.vscode/
87
postgres-data/
98
mysql-data/
Collapse file

‎.vscode/settings.json‎

Copy file name to clipboard
+11Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"rust-analyzer.cargo.features": ["postgres, mssql, mysql, migrations"],
3+
"rust-analyzer.check.workspace": true,
4+
"rust-analyzer.cargo.buildScripts.enable": true,
5+
"rust-analyzer.procMacro.enable": true,
6+
"rust-analyzer.diagnostics.disabled": ["unresolved-proc-macro"],
7+
"rust-analyzer.linkedProjects": [
8+
"./Cargo.toml"
9+
]
10+
}
11+
Collapse file

‎Cargo.toml‎

Copy file name to clipboardExpand all lines: Cargo.toml
+40-18Lines changed: 40 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,17 @@ description.workspace = true
1111

1212
[workspace]
1313
members = [
14-
"canyon_connection",
14+
"canyon_core",
1515
"canyon_crud",
1616
"canyon_entities",
1717
"canyon_migrations",
1818
"canyon_macros",
19-
"tests"
19+
"tests",
2020
]
2121

2222
[dependencies]
2323
# Project crates
24-
canyon_connection = { workspace = true }
24+
canyon_core = { workspace = true }
2525
canyon_crud = { workspace = true }
2626
canyon_entities = { workspace = true }
2727
canyon_migrations = { workspace = true, optional = true }
@@ -35,47 +35,69 @@ mysql_common = { workspace = true, optional = true }
3535

3636

3737
[workspace.dependencies]
38+
canyon_core = { version = "0.5.1", path = "canyon_core" }
3839
canyon_crud = { version = "0.5.1", path = "canyon_crud" }
39-
canyon_connection = { version = "0.5.1", path = "canyon_connection" }
4040
canyon_entities = { version = "0.5.1", path = "canyon_entities" }
4141
canyon_migrations = { version = "0.5.1", path = "canyon_migrations"}
4242
canyon_macros = { version = "0.5.1", path = "canyon_macros" }
4343

4444
tokio = { version = "1.27.0", features = ["full"] }
4545
tokio-util = { version = "0.7.4", features = ["compat"] }
4646
tokio-postgres = { version = "0.7.2", features = ["with-chrono-0_4"] }
47-
tiberius = { version = "0.12.1", features = ["tds73", "chrono", "integrated-auth-gssapi"] }
48-
mysql_async = { version = "0.32.2" }
49-
mysql_common = { version = "0.30.6", features = [ "chrono" ]}
47+
tiberius = { version = "0.12.3", features = ["tds73", "chrono"] }
48+
mysql_async = { version = "0.36.1" }
49+
mysql_common = { version = "0.35.4", features = [ "chrono" ]}
5050

5151
chrono = { version = "0.4", features = ["serde"] } # Just from TP better?
5252
serde = { version = "1.0.138", features = ["derive"] }
5353

5454
futures = "0.3.25"
55-
indexmap = "1.9.1"
5655
async-std = "1.12.0"
57-
lazy_static = "1.4.0"
5856
toml = "0.7.3"
59-
async-trait = "0.1.68"
6057
walkdir = "2.3.3"
6158
regex = "1.9.3"
6259
partialdebug = "0.2.0"
6360

64-
quote = "1.0.9"
65-
proc-macro2 = "1.0.27"
61+
quote = "1.0.47"
62+
proc-macro2 = "1.0.107"
6663

6764
[workspace.package]
6865
version = "0.5.1"
69-
edition = "2021"
70-
authors = ["Alex Vergara<[email protected]>, Gonzalo Busto Musi<[email protected]>"]
66+
edition = "2024"
67+
authors = ["Alex Vergara<[email protected]>, Gonzalo Busto Musi<[email protected]>"]
7168
documentation = "https://zerodaycode.github.io/canyon-book/"
7269
homepage = "https://github.com/zerodaycode/Canyon-SQL"
7370
readme = "README.md"
7471
license = "MIT"
7572
description = "A Rust ORM and QueryBuilder"
7673

7774
[features]
78-
postgres = ["tokio-postgres", "canyon_connection/postgres", "canyon_crud/postgres", "canyon_migrations/postgres", "canyon_macros/postgres"]
79-
mssql = ["tiberius", "canyon_connection/mssql", "canyon_crud/mssql", "canyon_migrations/mssql", "canyon_macros/mssql"]
80-
mysql = ["mysql_async", "mysql_common", "canyon_connection/mysql", "canyon_crud/mysql", "canyon_migrations/mysql", "canyon_macros/mysql"]
81-
migrations = ["canyon_migrations", "canyon_macros/migrations"]
75+
postgres = [
76+
"dep:tokio-postgres",
77+
"canyon_core/postgres",
78+
"canyon_crud/postgres",
79+
"canyon_migrations?/postgres",
80+
"canyon_macros/postgres",
81+
]
82+
83+
mssql = [
84+
"dep:tiberius",
85+
"canyon_core/mssql",
86+
"canyon_crud/mssql",
87+
"canyon_migrations?/mssql",
88+
"canyon_macros/mssql",
89+
]
90+
91+
mysql = [
92+
"dep:mysql_async",
93+
"dep:mysql_common",
94+
"canyon_core/mysql",
95+
"canyon_crud/mysql",
96+
"canyon_migrations?/mysql",
97+
"canyon_macros/mysql",
98+
]
99+
100+
migrations = [
101+
"dep:canyon_migrations",
102+
"canyon_macros/migrations",
103+
]
Collapse file

‎README.md‎

Copy file name to clipboardExpand all lines: README.md
+3-9Lines changed: 3 additions & 9 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ assert_eq!(
8484
);
8585
```
8686

87-
Note the leading reference on the `find_by_pk(...)` parameter. This associated function receives an `&dyn QueryParameter<'_>` as argument, not a value.
87+
Note the leading reference on the `find_by_pk(...)` parameter. This associated function receives an `&dyn QueryParameter` as argument, not a value.
8888

8989
### :wrench: Building more complex queries
9090

@@ -96,8 +96,8 @@ let mut select_with_joins = LeagueTournament::select_query();
9696
select_with_joins
9797
.inner_join("tournament", "league.id", "tournament.league_id")
9898
.left_join("team", "tournament.id", "player.tournament_id")
99-
.r#where(LeagueFieldValue::id(&7), Comp::Gt)
100-
.and(LeagueFieldValue::name(&"KOREA"), Comp::Eq)
99+
.r#where(LeagueFieldValue::id(&7), Operator::Gt)
100+
.and(LeagueFieldValue::name(&"KOREA"), Operator::Eq)
101101
.and_values_in(LeagueField::name, &["LCK", "STRANGER THINGS"]);
102102
// NOTE: We don't have in the docker the generated relationships
103103
// with the joins, so for now, we are just going to check that the
@@ -170,10 +170,4 @@ Could not find openssl via pkg-config:
170170
`sudo apt install pkg-config` on *apt* based systems. For other systems, you must read your package manager
171171
docs and install it.
172172

173-
### failed to run custom build command for `libgssapi-sys vX.X.X`
174-
175-
The problem is missing a *C* header `gssapi.h`.
176-
177-
- Alpine: `apk --update add krb5-pkinit krb5-dev krb5`
178-
- Ubuntu: `apt-get -y install gcc libgssapi-krb5-2 libkrb5-dev libsasl2-modules-gssapi-mit`
179173

Collapse file

‎bash_aliases.sh‎

Copy file name to clipboardExpand all lines: bash_aliases.sh
+6-1Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ alias DockerDown='docker-compose -f ./docker/docker-compose.yml down'
1414
# Cleans the generated cache folder for the postgres in the docker
1515
alias CleanPostgres='rm -rf ./docker/postgres-data'
1616

17+
# Code Quality
18+
alias Clippy='cargo clippy --all-targets --all-features --workspace -- -D warnings'
19+
alias Fmt='cargo fmt --all -- --check'
20+
1721
# Build the project for Windows targets
1822
alias BuildCanyonWin='cargo build --all-features --target=x86_64-pc-windows-msvc'
1923
alias BuildCanyonWinFull='cargo clean && cargo build --all-features --target=x86_64-pc-windows-msvc'
@@ -37,10 +41,11 @@ alias IntegrationTestsLinux='cargo test --all-features --no-fail-fast -p tests -
3741
alias ITIncludeIgnoredLinux='cargo test --all-features --no-fail-fast -p tests --target=x86_64-unknown-linux-gnu -- --show-output --test-threads=1 --nocapture --test-threads=1 --include-ignored'
3842
alias SqlServerInitializationLinux='cargo test initialize_sql_server_docker_instance -p tests --all-features --no-fail-fast --target=x86_64-unknown-linux-gnu -- --show-output --test-threads=1 --nocapture --include-ignored'
3943

40-
44+
# -----
4145
# Publish Canyon-SQL to the registry with its dependencies
4246
alias PublishCanyon='cargo publish -p canyon_connection && cargo publish -p canyon_crud && cargo publish -p canyon_migrations && cargo publish -p canyon_macros && cargo publish -p canyon_sql_root'
4347

48+
# -----
4449
# Collects the code coverage for the project (tests must run before this)
4550
alias CcEnvVars='export CARGO_INCREMENTAL=0
4651
export RUSTFLAGS="-Zprofile -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort"

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.