Skip to content

Commit 8e9a4e2

Browse files
committed
feat: initial setup with source, CI, README, and LICENSE
0 parents  commit 8e9a4e2

16 files changed

Lines changed: 2091 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
check:
13+
runs-on: ubuntu-latest
14+
timeout-minutes: 15
15+
steps:
16+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
17+
- uses: dtolnay/rust-toolchain@3c5f7ea28cd621ae0bf5283f0e981fb97b8a7af9 # stable
18+
with:
19+
toolchain: stable
20+
- run: cargo check
21+
22+
clippy:
23+
runs-on: ubuntu-latest
24+
timeout-minutes: 15
25+
steps:
26+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
27+
- uses: dtolnay/rust-toolchain@3c5f7ea28cd621ae0bf5283f0e981fb97b8a7af9 # stable
28+
with:
29+
toolchain: stable
30+
components: clippy
31+
- run: cargo clippy -- -D warnings
32+
33+
fmt:
34+
runs-on: ubuntu-latest
35+
timeout-minutes: 10
36+
steps:
37+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
38+
- uses: dtolnay/rust-toolchain@3c5f7ea28cd621ae0bf5283f0e981fb97b8a7af9 # stable
39+
with:
40+
toolchain: stable
41+
components: rustfmt
42+
- run: cargo fmt --check
43+
44+
test:
45+
runs-on: ubuntu-latest
46+
timeout-minutes: 15
47+
steps:
48+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
49+
- uses: dtolnay/rust-toolchain@3c5f7ea28cd621ae0bf5283f0e981fb97b8a7af9 # stable
50+
with:
51+
toolchain: stable
52+
- run: cargo test --lib

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/target
2+
Cargo.lock

Cargo.toml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
[package]
2+
name = "cloud-sql-connector"
3+
version = "0.1.0"
4+
edition = "2024"
5+
description = "Cloud SQL connector for Rust"
6+
license = "MIT"
7+
repository = "https://github.com/tailor-platform/cloud-sql-connector-rs"
8+
9+
[dependencies]
10+
gcp_auth = "0.12.6"
11+
reqwest = { version = "0.13.0", features = ["json", "rustls"], default-features = false }
12+
rustls = { version = "0.23.28", default-features = false, features = ["ring", "std"] }
13+
rustls-pemfile = "2.2.0"
14+
tokio-rustls = "0.26.4"
15+
tokio-postgres = "0.7.15"
16+
deadpool = "0.12.3"
17+
rsa = "0.9.9"
18+
rand = "0.10.0"
19+
rand_core = "0.6"
20+
pkcs8 = { version = "0.10.2", features = ["pem"] }
21+
tokio = { version = "1.49.0", features = ["rt", "time", "sync", "macros"] }
22+
arc-swap = "1.7.1"
23+
thiserror = "2.0.17"
24+
tracing = "0.1.41"
25+
serde = { version = "1.0.228", features = ["derive"] }
26+
serde_json = "1.0.149"
27+
chrono = { version = "0.4.42", features = ["serde"] }
28+
x509-parser = "0.18.0"

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2026 Tailor Inc.
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# cloud-sql-connector
2+
3+
A Rust connector for [Google Cloud SQL](https://cloud.google.com/sql). Provides secure, authenticated connections to Cloud SQL instances using IAM authentication and automatic certificate management.
4+
5+
## Features
6+
7+
- Automatic TLS certificate management with background refresh
8+
- IAM-based authentication
9+
- Connection pooling via [deadpool](https://crates.io/crates/deadpool)
10+
- Support for both public and private IP connections
11+
12+
## Usage
13+
14+
```rust
15+
use cloud_sql_connector::{CloudSqlConfig, CloudSqlConnector};
16+
17+
let config = CloudSqlConfig::new("my-project:us-central1:my-instance")
18+
.with_iam_auth(true);
19+
20+
let connector = CloudSqlConnector::new(config).await?;
21+
let pool = connector.create_pool("my_database", "my_user", None)?;
22+
let conn = pool.get().await?;
23+
```
24+
25+
## License
26+
27+
MIT

0 commit comments

Comments
 (0)