Skip to content

Commit 6eb40b1

Browse files
committed
Added support for just array in JSONB column
1 parent 0989b7d commit 6eb40b1

File tree

6 files changed

+13
-13
lines changed

6 files changed

+13
-13
lines changed

src/driver/connection.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ impl Connection {
401401
/// Create new transaction object.
402402
///
403403
/// # Errors
404-
/// May return Err Result if db_client is None.
404+
/// May return Err Result if `db_client` is None.
405405
#[pyo3(signature = (
406406
isolation_level=None,
407407
read_variant=None,

src/driver/connection_pool_builder.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ impl ConnectionPoolBuilder {
7676
))
7777
}
7878

79-
/// Set ca_file for ssl_mode in PostgreSQL.
79+
/// Set `ca_file` for `ssl_mode` in `PostgreSQL`.
8080
fn ca_file(self_: Py<Self>, ca_file: String) -> Py<Self> {
8181
Python::with_gil(|gil| {
8282
let mut self_ = self_.borrow_mut(gil);
@@ -241,7 +241,7 @@ impl ConnectionPoolBuilder {
241241
/// Sets the TCP user timeout.
242242
///
243243
/// This is ignored for Unix domain socket connections. It is only supported on systems where
244-
/// TCP_USER_TIMEOUT is available and will default to the system default if omitted or set to 0;
244+
/// `TCP_USER_TIMEOUT` is available and will default to the system default if omitted or set to 0;
245245
/// on other systems, it has no effect.
246246
#[must_use]
247247
pub fn tcp_user_timeout(self_: Py<Self>, tcp_user_timeout: u64) -> Py<Self> {
@@ -314,7 +314,7 @@ impl ConnectionPoolBuilder {
314314
}
315315

316316
/// Sets the time interval between TCP keepalive probes.
317-
/// On Windows, this sets the value of the tcp_keepalive struct’s keepaliveinterval field.
317+
/// On Windows, this sets the value of the `tcp_keepalive` struct’s keepaliveinterval field.
318318
///
319319
/// This is ignored for Unix domain sockets, or if the `keepalives` option is disabled.
320320
#[must_use]

src/driver/transaction.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ impl Transaction {
309309
/// Execute many queries in a transaction.
310310
///
311311
/// More information in a documentation:
312-
/// https://psqlpy-python.github.io/components/transaction.html#pipeline
312+
/// `<https://psqlpy-python.github.io/components/transaction.html#pipeline>`
313313
///
314314
/// # Errors
315315
/// Can return error if there is a problem with DB communication.

src/extra_types.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ impl Text {
9797

9898
#[pymethods]
9999
impl Text {
100-
/// Create new PyText from Python str.
100+
/// Create new `PyText` from Python str.
101101
#[new]
102102
#[allow(clippy::missing_errors_doc)]
103103
#[must_use]
@@ -121,7 +121,7 @@ impl VarChar {
121121

122122
#[pymethods]
123123
impl VarChar {
124-
/// Create new PyVarChar from Python str.
124+
/// Create new `PyVarChar` from Python str.
125125
#[new]
126126
#[allow(clippy::missing_errors_doc)]
127127
#[must_use]

src/options.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ pub enum SynchronousCommit {
175175
/// As the name indicates, the commit acknowledgment can come before
176176
/// flushing the records to disk.
177177
/// This is generally called as an asynchronous commit.
178-
/// If the PostgreSQL instance crashes,
178+
/// If the `PostgreSQL` instance crashes,
179179
/// the last few asynchronous commits might be lost.
180180
Off,
181181
/// WAL records are written and flushed to local disks.

src/value_converter/models/serde_value.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -108,17 +108,17 @@ fn serde_value_from_dict(bind_value: &Bound<'_, PyAny>) -> PSQLPyResult<Value> {
108108
/// # Errors
109109
/// May return error if cannot convert Python type into Rust one.
110110
#[allow(clippy::needless_pass_by_value)]
111+
#[allow(clippy::needless_return)]
111112
pub fn build_serde_value(value: &Bound<'_, PyAny>) -> PSQLPyResult<Value> {
112113
Python::with_gil(|gil| {
113114
if value.is_instance_of::<PyList>() {
114-
serde_value_from_list(gil, value)
115+
return serde_value_from_list(gil, value);
115116
} else if value.is_instance_of::<PyDict>() {
116117
return serde_value_from_dict(value);
117-
} else {
118-
return Err(RustPSQLDriverError::PyToRustValueConversionError(
119-
"PyJSON must be dict or list value.".to_string(),
120-
));
121118
}
119+
Err(RustPSQLDriverError::PyToRustValueConversionError(
120+
"PyJSON must be dict or list value.".to_string(),
121+
))
122122
})
123123
}
124124

0 commit comments

Comments
 (0)