Skip to content

Commit

Permalink
Fix minor typos (#113)
Browse files Browse the repository at this point in the history
* docs: Fix minor typos

* chore: Fix minor typos
  • Loading branch information
utilForever authored May 31, 2024
1 parent d047321 commit 666c924
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion book/src/api/1.1.cli-options.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# sqlx-ts CLI Opitons
# sqlx-ts CLI Options

To check the latest CLI options available, please run

Expand Down
2 changes: 1 addition & 1 deletion book/src/guides/1.1.install_sh_cli_options.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ You can find the latest releases of sqlx-ts here to find an appropriate value fo
| --os | Your current OS, it's used to determine the type of binary to be installed (one of macos or win32 or linux) |
| --artifact | Specific artifact to install. Please find the artifact name from https://github.com/JasonShin/sqlx-ts/releases (e.g. sqlx_ts_v0.1.0_x86_64-apple-darwin.zip) |
| --tag | Tag (version) of the crate to install (default ) |
| --to | Where to install the binary (default to `.` or `pwd` current diretory) |
| --to | Where to install the binary (default to `.` or `pwd` current directory) |
2 changes: 1 addition & 1 deletion book/src/reference-guide/4.2.INSERT.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export interface ISomeQueryQuery {

#### PostgreSQL

As query params of PostgresSQL uses the numbered paramters, it's meaningless to generate a nested array respresnetation of them.
As query params of PostgresSQL uses the numbered parameters, it's meaningless to generate a nested array respresnetation of them.

If you have

Expand Down
2 changes: 1 addition & 1 deletion book/src/reference-guide/4.4.UPDATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export interface ISomeQueryQuery {

#### PostgreSQL

As query params of PostgresSQL uses the numbered paramters, it's meaningless to generate a nested array respresnetation of them.
As query params of PostgresSQL uses the numbered parameters, it's meaningless to generate a nested array respresnetation of them.

If you have

Expand Down
2 changes: 1 addition & 1 deletion src/parser/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ pub fn parse_source(path: &PathBuf) -> Result<(HashMap<PathBuf, Vec<SQL>>, Handl
},
}

// This is to prevent any emptry string queries being inserted into sqls_map
// This is to prevent any empty string queries being inserted into sqls_map
// which will be used to run `PREPARE` step and SQL parser logic
let sqls: Vec<SQL> = sqls.into_iter().filter(|sql| !sql.query.is_empty()).collect();
insert_or_append_sqls(&mut sqls_map, &sqls, path);
Expand Down
2 changes: 1 addition & 1 deletion src/ts_generator/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ pub enum TsGeneratorError {
#[error("[E010] Unknown function detected while processing a SELECT clause - query: `{0}`")]
FunctionUnknown(String),
#[error("[E011] table name was not found while processing an identifier - query: `{0}`")]
IndentifierWithoutTable(String),
IdentifierWithoutTable(String),
#[error("[E012] Failed to handle a from statement without the `FROM` keyword - query: `{0}`")]
FromWithoutKeyword(String),
#[error("Unknown error: `{0}`")]
Expand Down
2 changes: 1 addition & 1 deletion src/ts_generator/sql_parser/expressions/functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ pub static DATE_FUNCTIONS: &[&str] = &[
"CURDATE",
"CURRENT_DATE",
"CURRENT_TIME",
"CURRENT_TIMESTEMP",
"CURRENT_TIMESTAMP",
"CURTIME",
"DATE",
"DATE_ADD",
Expand Down
2 changes: 1 addition & 1 deletion src/ts_generator/sql_parser/expressions/translate_expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ pub async fn translate_expr(
let ident = idents[1].value.clone();

let table_name = translate_table_from_expr(table_with_joins, expr)
.ok_or_else(|| TsGeneratorError::IndentifierWithoutTable(expr.to_string()))?;
.ok_or_else(|| TsGeneratorError::IdentifierWithoutTable(expr.to_string()))?;

let table_details = &DB_SCHEMA
.lock()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ pub fn translate_table_with_joins(
SelectItem::Wildcard(_) => Some(default_table_name),
SelectItem::ExprWithAlias { expr, alias: _ } => match &expr {
Expr::Identifier(_) => {
// if the select item is not a compount identifier with an expression, just return the default table name
// if the select item is not a compound identifier with an expression, just return the default table name
Some(default_table_name)
}
Expr::CompoundIdentifier(compound_identifier) => {
Expand Down
2 changes: 1 addition & 1 deletion tests/postgres_query_parameters.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#[cfg(test)]
mod postgres_query_paramters_tests {
mod postgres_query_parameters_tests {
use assert_cmd::prelude::*;
use predicates::prelude::*;
use std::env;
Expand Down

0 comments on commit 666c924

Please sign in to comment.