Skip to content

Commit

Permalink
Merge pull request #1 from asteinba/fix-encode-decode-derives
Browse files Browse the repository at this point in the history
Rebase on main
  • Loading branch information
benluelo authored Jan 8, 2024
2 parents 3beedf3 + b5592b0 commit 39bb514
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 21 deletions.
21 changes: 7 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,20 @@
<div align="center">
<!-- Github Actions -->
<a href="https://github.com/launchbadge/sqlx/actions/workflows/sqlx.yml?query=branch%3Amain">
<img src="https://img.shields.io/github/actions/workflow/status/launchbadge/sqlx/sqlx.yml?branch=main&style=flat-square"
alt="actions status" />
</a>
<img src="https://img.shields.io/github/actions/workflow/status/launchbadge/sqlx/sqlx.yml?branch=main&style=flat-square" alt="actions status" /></a>
<!-- Version -->
<a href="https://crates.io/crates/sqlx">
<img src="https://img.shields.io/crates/v/sqlx.svg?style=flat-square"
alt="Crates.io version" />
</a>
alt="Crates.io version" /></a>
<!-- Discord -->
<a href="https://discord.gg/uuruzJ7">
<img src="https://img.shields.io/discord/665528275556106240?style=flat-square" alt="chat" />
</a>
<img src="https://img.shields.io/discord/665528275556106240?style=flat-square" alt="chat" /></a>
<!-- Docs -->
<a href="https://docs.rs/sqlx">
<img src="https://img.shields.io/badge/docs-latest-blue.svg?style=flat-square"
alt="docs.rs docs" />
</a>
<img src="https://img.shields.io/badge/docs-latest-blue.svg?style=flat-square" alt="docs.rs docs" /></a>
<!-- Downloads -->
<a href="https://crates.io/crates/sqlx">
<img src="https://img.shields.io/crates/d/sqlx.svg?style=flat-square"
alt="Download" />
<img src="https://img.shields.io/crates/d/sqlx.svg?style=flat-square" alt="Download" />
</a>
</div>

Expand Down Expand Up @@ -82,8 +75,8 @@ SQLx is an async, pure Rust<sub>†</sub> SQL crate featuring compile-time check
† The SQLite driver uses the libsqlite3 C library as SQLite is an embedded database (the only way
we could be pure Rust for SQLite is by porting _all_ of SQLite to Rust).

†† SQLx uses `#![forbid(unsafe_code)]` unless the `sqlite` feature is enabled. As the SQLite driver interacts
with C, those interactions are `unsafe`.
†† SQLx uses `#![forbid(unsafe_code)]` unless the `sqlite` feature is enabled.
The SQLite driver directly invokes the SQLite3 API via `libsqlite3-sys`, which requires `unsafe`.

</small></small>

Expand Down
2 changes: 1 addition & 1 deletion sqlx-core/src/from_row.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ use crate::{error::Error, row::Row};
/// will set the value of the field `location` to the default value of `Option<String>`,
/// which is `None`.
///
/// Moreover, if the struct has an implementation for [`Default`], you can use the `default``
/// Moreover, if the struct has an implementation for [`Default`], you can use the `default`
/// attribute at the struct level rather than for each single field. If a field does not appear in the result,
/// its value is taken from the `Default` implementation for the struct.
/// For example:
Expand Down
4 changes: 3 additions & 1 deletion sqlx-core/src/net/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
mod socket;
pub mod tls;

pub use socket::{connect_tcp, connect_uds, BufferedSocket, Socket, SocketIntoBox, WithSocket};
pub use socket::{
connect_tcp, connect_uds, BufferedSocket, Socket, SocketIntoBox, WithSocket, WriteBuffer,
};
4 changes: 3 additions & 1 deletion sqlx-core/src/net/socket/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,8 @@ pub async fn connect_uds<P: AsRef<Path>, Ws: WithSocket>(
) -> crate::Result<Ws::Output> {
#[cfg(not(unix))]
{
drop((path, with_socket));

return Err(io::Error::new(
io::ErrorKind::Unsupported,
"Unix domain sockets are not supported on this platform",
Expand All @@ -270,7 +272,7 @@ pub async fn connect_uds<P: AsRef<Path>, Ws: WithSocket>(
return Ok(with_socket.with_socket(stream));
}

#[cfg(not(feature = "_rt-async-std"))]
#[cfg(all(unix, not(feature = "_rt-async-std")))]
{
crate::rt::missing_rt((path, with_socket))
}
Expand Down
4 changes: 0 additions & 4 deletions sqlx-postgres/src/copy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -221,10 +221,6 @@ impl<C: DerefMut<Target = PgConnection>> PgCopyIn<C> {
}

let conn: &mut PgConnection = self.conn.as_deref_mut().expect("copy_from: conn taken");

// flush any existing messages in the buffer and clear it
conn.stream.flush().await?;

loop {
let buf = conn.stream.write_buffer_mut();

Expand Down
1 change: 1 addition & 0 deletions sqlx-postgres/src/message/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ pub use copy::{CopyData, CopyDone, CopyFail, CopyResponse};
pub use data_row::DataRow;
pub use describe::Describe;
pub use execute::Execute;
#[allow(unused_imports)]
pub use flush::Flush;
pub use notification::Notification;
pub use parameter_description::ParameterDescription;
Expand Down

0 comments on commit 39bb514

Please sign in to comment.