mirror of
https://github.com/launchbadge/sqlx.git
synced 2025-12-25 17:50:23 +00:00
fix spelling (#4069)
This commit is contained in:
parent
e4afbd4ca1
commit
e8384f2a00
@ -11,7 +11,7 @@ pub enum Error {
|
||||
/// A SQLx call returned an error.
|
||||
///
|
||||
/// The exact error contents are not reported to the user in order to avoid leaking
|
||||
/// information about databse internals.
|
||||
/// information about database internals.
|
||||
#[error("an internal database error occurred")]
|
||||
Sqlx(#[from] sqlx::Error),
|
||||
|
||||
|
||||
@ -30,7 +30,7 @@ impl Display for PostWithAuthorQuery {
|
||||
async fn main() -> anyhow::Result<()> {
|
||||
let pool = PgPool::connect(&dotenvy::var("DATABASE_URL")?).await?;
|
||||
|
||||
// we can use a tranditional wrapper around the `query!()` macro using files
|
||||
// we can use a traditional wrapper around the `query!()` macro using files
|
||||
query_file!("queries/insert_seed_data.sql")
|
||||
.execute(&pool)
|
||||
.await?;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
[migrate]
|
||||
# Ignore common whitespace characters (beware syntatically significant whitespace!)
|
||||
# Ignore common whitespace characters (beware syntactically significant whitespace!)
|
||||
# Space, tab, CR, LF, zero-width non-breaking space (U+FEFF)
|
||||
#
|
||||
# U+FEFF is added by some editors as a magic number at the beginning of a text file indicating it is UTF-8 encoded,
|
||||
|
||||
@ -206,7 +206,7 @@ migrations-dir = "foo/migrations"
|
||||
# Note that the TOML format requires double-quoted strings to process escapes.
|
||||
# ignored-chars = ["\r"]
|
||||
|
||||
# Ignore common whitespace characters (beware syntatically significant whitespace!)
|
||||
# Ignore common whitespace characters (beware syntactically significant whitespace!)
|
||||
# Space, tab, CR, LF, zero-width non-breaking space (U+FEFF)
|
||||
#
|
||||
# U+FEFF is added by some editors as a magic number at the beginning of a text file indicating it is UTF-8 encoded,
|
||||
|
||||
@ -84,7 +84,7 @@ pub enum Error {
|
||||
source: BoxDynError,
|
||||
},
|
||||
|
||||
/// Error occured while encoding a value.
|
||||
/// Error occurred while encoding a value.
|
||||
#[error("error occurred while encoding a value: {0}")]
|
||||
Encode(#[source] BoxDynError),
|
||||
|
||||
|
||||
@ -193,7 +193,7 @@ CREATE TABLE IF NOT EXISTS {table_name} (
|
||||
migration: &'e Migration,
|
||||
) -> BoxFuture<'e, Result<Duration, MigrateError>> {
|
||||
Box::pin(async move {
|
||||
// Use a single transaction for the actual migration script and the essential bookeeping so we never
|
||||
// Use a single transaction for the actual migration script and the essential bookkeeping so we never
|
||||
// execute migrations twice. See https://github.com/launchbadge/sqlx/issues/1966.
|
||||
// The `execution_time` however can only be measured for the whole transaction. This value _only_ exists for
|
||||
// data lineage and debugging reasons, so it is not super important if it is lost. So we initialize it to -1
|
||||
@ -268,7 +268,7 @@ CREATE TABLE IF NOT EXISTS {table_name} (
|
||||
migration: &'e Migration,
|
||||
) -> BoxFuture<'e, Result<Duration, MigrateError>> {
|
||||
Box::pin(async move {
|
||||
// Use a single transaction for the actual migration script and the essential bookeeping so we never
|
||||
// Use a single transaction for the actual migration script and the essential bookkeeping so we never
|
||||
// execute migrations twice. See https://github.com/launchbadge/sqlx/issues/1966.
|
||||
let mut tx = self.begin().await?;
|
||||
let start = Instant::now();
|
||||
|
||||
@ -18,7 +18,7 @@ impl<'de> ProtocolDecode<'de, &'de [MySqlColumn]> for BinaryRow {
|
||||
let header = buf.get_u8();
|
||||
if header != 0 {
|
||||
return Err(err_protocol!(
|
||||
"exepcted 0x00 (ROW) but found 0x{:02x}",
|
||||
"expected 0x00 (ROW) but found 0x{:02x}",
|
||||
header
|
||||
));
|
||||
}
|
||||
|
||||
@ -41,7 +41,7 @@ bitflags! {
|
||||
/// Field is an enumeration.
|
||||
const ENUM = 256;
|
||||
|
||||
/// Field is an auto-incement field.
|
||||
/// Field is an auto-increment field.
|
||||
const AUTO_INCREMENT = 512;
|
||||
|
||||
/// Field is a timestamp.
|
||||
|
||||
@ -136,8 +136,8 @@ impl AnyConnectionBackend for PgConnection {
|
||||
) -> BoxFuture<'c, sqlx_core::Result<AnyStatement>> {
|
||||
Box::pin(async move {
|
||||
let statement = Executor::prepare_with(self, sql, &[]).await?;
|
||||
let colunn_names = statement.metadata.column_names.clone();
|
||||
AnyStatement::try_from_statement(statement, colunn_names)
|
||||
let column_names = statement.metadata.column_names.clone();
|
||||
AnyStatement::try_from_statement(statement, column_names)
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@ -41,7 +41,7 @@ impl FrontendMessage for SaslInitialResponse<'_> {
|
||||
|
||||
let response_len = i32::try_from(self.response.len()).map_err(|_| {
|
||||
err_protocol!(
|
||||
"SASL Initial Response length too long for protcol: {}",
|
||||
"SASL Initial Response length too long for protocol: {}",
|
||||
self.response.len()
|
||||
)
|
||||
})?;
|
||||
|
||||
@ -231,7 +231,7 @@ CREATE TABLE IF NOT EXISTS {table_name} (
|
||||
if migration.no_tx {
|
||||
execute_migration(self, table_name, migration).await?;
|
||||
} else {
|
||||
// Use a single transaction for the actual migration script and the essential bookeeping so we never
|
||||
// Use a single transaction for the actual migration script and the essential bookkeeping so we never
|
||||
// execute migrations twice. See https://github.com/launchbadge/sqlx/issues/1966.
|
||||
// The `execution_time` however can only be measured for the whole transaction. This value _only_ exists for
|
||||
// data lineage and debugging reasons, so it is not super important if it is lost. So we initialize it to -1
|
||||
|
||||
@ -173,8 +173,8 @@ fn find_next_field<'a>(line: &mut &'a str) -> Option<Cow<'a, str>> {
|
||||
let mut escaped_string = None;
|
||||
let mut last_added = 0;
|
||||
|
||||
let char_indicies = line.char_indices();
|
||||
for (idx, c) in char_indicies {
|
||||
let char_indices = line.char_indices();
|
||||
for (idx, c) in char_indices {
|
||||
if c == ':' && !escaping {
|
||||
let (field, rest) = line.split_at(idx);
|
||||
*line = &rest[1..];
|
||||
|
||||
@ -15,7 +15,7 @@ const BYTE_WIDTH: usize = mem::size_of::<f64>();
|
||||
/// Description: Polygon (similar to closed polygon)
|
||||
/// Representation: `((x1,y1),...)`
|
||||
///
|
||||
/// Polygons are represented by lists of points (the vertexes of the polygon). Polygons are very similar to closed paths; the essential semantic difference is that a polygon is considered to include the area within it, while a path is not.
|
||||
/// Polygons are represented by lists of points (the vertices of the polygon). Polygons are very similar to closed paths; the essential semantic difference is that a polygon is considered to include the area within it, while a path is not.
|
||||
/// An important implementation difference between polygons and paths is that the stored representation of a polygon includes its smallest bounding box. This speeds up certain search operations, although computing the bounding box adds overhead while constructing new polygons.
|
||||
/// Values of type polygon are specified using any of the following syntaxes:
|
||||
///
|
||||
|
||||
@ -417,7 +417,7 @@ async fn copy_can_work_with_failed_transactions() -> anyhow::Result<()> {
|
||||
|
||||
tx.rollback().await?;
|
||||
|
||||
// conn should be usable again, as we explictly rolled back the transaction
|
||||
// conn should be usable again, as we explicitly rolled back the transaction
|
||||
let got: i32 = sqlx::query_scalar("SELECT 1")
|
||||
.fetch_one(conn.as_mut())
|
||||
.await?;
|
||||
@ -445,7 +445,7 @@ async fn it_can_work_with_failed_transactions() -> anyhow::Result<()> {
|
||||
.is_err());
|
||||
tx.rollback().await?;
|
||||
|
||||
// conn should be usable again, as we explictly rolled back the transaction
|
||||
// conn should be usable again, as we explicitly rolled back the transaction
|
||||
let got: i32 = sqlx::query_scalar("SELECT 1")
|
||||
.fetch_one(conn.as_mut())
|
||||
.await?;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user