Skip to content

Commit

Permalink
Adds v16 feature
Browse files Browse the repository at this point in the history
  • Loading branch information
sanpii committed Dec 16, 2023
1 parent 718b8d3 commit 6cffdbf
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 4 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
matrix:
rust: ["stable", "beta", "nightly"]
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
pg: ["10", "11", "12", "13", "14", "15"]
pg: ["10", "11", "12", "13", "14", "15", "16"]
mode: ["debug", "release"]
exclude:
- os: "macos-latest"
Expand All @@ -48,6 +48,8 @@ jobs:
pg: "13"
- os: "macos-latest"
pg: "15"
- os: "macos-latest"
pg: "16"
- os: "windows-latest"
pg: "11"
- os: "windows-latest"
Expand All @@ -58,6 +60,8 @@ jobs:
pg: "14"
- os: "windows-latest"
pg: "15"
- os: "windows-latest"
pg: "16"
runs-on: ${{ matrix.os }}

steps:
Expand Down
6 changes: 3 additions & 3 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ lint:clippy:
<<: *pg
variables:
MODE: debug
PG: "14"
PG: "16"
stage: lint
script:
- rustup component add clippy
Expand All @@ -38,7 +38,7 @@ test:
parallel:
matrix:
- MODE: ['debug', 'release']
PG: ['9.5', '9.6', '10', '11', '12', '13', '14']
PG: ['9.5', '9.6', '10', '11', '12', '13', '14', '15', '16']
script: |
feature=''
Expand Down Expand Up @@ -81,4 +81,4 @@ arm:
- apt-get update
- apt-get install -y curl git build-essential
- apt-get install -y libc6-armhf-cross libc6-dev-armhf-cross gcc-arm-linux-gnueabihf clang
script: cargo build --all-features --target arm-unknown-linux-gnueabihf
script: cargo build --features v15 --target arm-unknown-linux-gnueabihf
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,4 @@ v12 = ["v11"]
v13 = ["v12"]
v14 = ["v13", "bitflags"]
v15 = ["v14"]
v16 = ["v15"]
11 changes: 11 additions & 0 deletions src/connection/_gss.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,15 @@ impl Connection {
pub fn gss_context(&self) -> *const std::ffi::c_void {
unsafe { pq_sys::PQgetgssctx(self.into()) }
}

/**
* Returns `true` if the connection authentication method used GSSAPI. Returns `false` if not.
*
* See
* [PQconnectionUsedGSSAPI](https://www.postgresql.org/docs/16/libpq-status.html#LIBPQ-PQCONNECTIONUSEDGSSAPI).
*/
#[cfg(feature = "v16")]
pub fn used_gssapi(&self) -> bool {
unsafe { pq_sys::PQconnectionUsedGSSAPI(self.into()) != 0 }
}
}
8 changes: 8 additions & 0 deletions src/connection/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -636,4 +636,12 @@ B 5 ReadyForQuery I
),
);
}

#[test]
#[cfg(feature = "v16")]
fn used_gssapi() {
let conn = crate::test::new_conn();

assert_eq!(conn.used_gssapi(), false);
}
}

0 comments on commit 6cffdbf

Please sign in to comment.