Skip to content

Commit

Permalink
Release version 1.0.0 (#154)
Browse files Browse the repository at this point in the history
<!-- The PR description should answer 2 (maybe 3) important questions:
-->

### What
Added ca certs to docker file to solve azure sql server connection
errors. Bumped version to 1.0.0.
  • Loading branch information
codedmart authored Dec 6, 2024
1 parent c33ff7e commit 205ecee
Show file tree
Hide file tree
Showing 15 changed files with 45 additions and 43 deletions.
16 changes: 8 additions & 8 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[workspace]
resolver = "2"

package.version = "0.2.2"
package.version = "1.0.0"
package.edition = "2021"

members = [
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
[![Docs](https://img.shields.io/badge/docs-v3.x-brightgreen.svg?style=flat)](https://hasura.io/docs/3.0)
[![ndc-hub](https://img.shields.io/badge/ndc--hub-sqlserver-blue.svg?style=flat)](https://hasura.io/connectors/sqlserver)
[![License](https://img.shields.io/badge/license-Apache--2.0-purple.svg?style=flat)](LICENSE.txt)
[![Status](https://img.shields.io/badge/status-alpha-yellow.svg?style=flat)](./readme.md)

With this connector, Hasura allows you to instantly create a real-time GraphQL API on top of your data models in
Microsoft SQL Server. This connector supports SQL Server's functionalities listed in the table below, allowing for
Expand Down
8 changes: 6 additions & 2 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,24 @@

### Fixed

## [v1.0.0]

### Fixed

- Added CA certs to container for TLS <https://github.com/hasura/ndc-sqlserver/pull/154>

## [v0.2.2]

### Changed

- ndc-spec version to v1.6.0


## [v0.2.1]

### Added

- Add subcommand `stored-procedures` to the `update` command to introspect stored procedures.


## [v0.2.0]

### Added
Expand Down
1 change: 0 additions & 1 deletion crates/ndc-sqlserver/src/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@ fn make_procedure_type(
}

/// Gets the schema of the native mutations.
/// Each native mutation creates two objects:
/// 1. Object with name `{native_mutation_name}_response`, this object
/// will contain two fields:
Expand Down
1 change: 0 additions & 1 deletion crates/query-engine/execution/src/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ pub(crate) async fn execute_statement(

/// Match on the result and execute a rollback statement against the database if we run into an
/// error.
pub async fn rollback_on_exception<T>(
result: Result<T, Error>,
connection: &mut bb8::PooledConnection<'_, bb8_tiberius::ConnectionManager>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ impl Serialize for NativeQuerySql {

struct NQVisitor;

impl<'de> serde::de::Visitor<'de> for NQVisitor {
impl serde::de::Visitor<'_> for NQVisitor {
type Value = NativeQuerySql;

fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
Expand Down
10 changes: 4 additions & 6 deletions crates/query-engine/sql/src/sql/convert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,9 +216,8 @@ impl Select {

sql.append_syntax(" ");

match &self.from {
Some(from) => from.to_sql(sql),
None => (),
if let Some(from) = &self.from {
from.to_sql(sql)
}

for join in self.joins.iter() {
Expand All @@ -229,9 +228,8 @@ impl Select {

self.order_by.to_sql(sql);

match &self.limit {
Some(limit) => limit.to_sql(sql),
None => (),
if let Some(limit) = &self.limit {
limit.to_sql(sql)
}

self.for_json.to_sql(sql);
Expand Down
2 changes: 1 addition & 1 deletion crates/query-engine/translation/src/translation/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ impl<'a> Env<'a> {
pub fn new(
metadata: &'a metadata::Metadata,
relationships: BTreeMap<models::RelationshipName, models::Relationship>,
) -> Env {
) -> Env<'a> {
Env {
metadata,
relationships,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ use query_engine_sql::sql;

pub struct JoinFieldInfo {
pub table_alias: sql::ast::TableAlias,
pub column_alias: sql::ast::ColumnAlias,
pub relationship_name: String,
pub arguments: BTreeMap<models::ArgumentName, models::RelationshipArgument>,
pub query: models::Query,
Expand Down
9 changes: 6 additions & 3 deletions crates/query-engine/translation/src/translation/query/root.rs
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,6 @@ pub fn translate_rows_query(
};
join_fields.push(relationships::JoinFieldInfo {
table_alias,
column_alias: column_alias.clone(),
relationship_name: relationship.to_string(),
arguments,
query: *query,
Expand Down Expand Up @@ -319,8 +318,12 @@ fn translate_query_part(
relationships::translate_joins(env, state, &root_and_current_tables, join_fields)?;

// translate order_by
let (order_by, order_by_joins) =
sorting::translate_order_by(env, state, &root_and_current_tables, &query.order_by)?;
let (order_by, order_by_joins) = sorting::translate_order_by(
env,
state,
&root_and_current_tables,
query.order_by.as_ref(),
)?;

relationship_joins.extend(order_by_joins);
// translate where
Expand Down
12 changes: 6 additions & 6 deletions crates/query-engine/translation/src/translation/query/sorting.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ pub fn translate_order_by(
env: &Env,
state: &mut State,
root_and_current_tables: &RootAndCurrentTables,
order_by: &Option<models::OrderBy>,
order_by: Option<&models::OrderBy>,
) -> Result<(sql::ast::OrderBy, Vec<sql::ast::Join>), Error> {
let mut joins: Vec<sql::ast::Join> = vec![];

Expand Down Expand Up @@ -214,7 +214,7 @@ fn translate_order_by_star_count_aggregate(
state,
root_and_current_tables,
relationship,
&path_element.predicate,
path_element.predicate.as_deref(),
select_cols,
(table, from_clause),
)?;
Expand Down Expand Up @@ -337,7 +337,7 @@ fn translate_order_by_target_for_column(
root_and_current_tables,
column_name,
path,
&function,
function.as_ref(),
&mut joins,
(last_table, (index, path_element)),
)
Expand Down Expand Up @@ -426,7 +426,7 @@ fn process_path_element_for_order_by_target_for_column(
root_and_current_tables: &RootAndCurrentTables,
target_column_name: &str,
path: &[models::PathElement],
aggregate_function_for_arrays: &Option<models::AggregateFunctionName>,
aggregate_function_for_arrays: Option<&models::AggregateFunctionName>,
// to get the information about this path element we need to select from the relevant table
// and join with the previous table. We add a new join to this list of joins.
joins: &mut Vec<sql::ast::OuterApply>,
Expand Down Expand Up @@ -510,7 +510,7 @@ fn process_path_element_for_order_by_target_for_column(
current_table: last_table,
},
relationship,
&path_element.predicate,
path_element.predicate.as_deref(),
sql::ast::SelectList::SelectList(select_cols),
(table.clone(), from_clause),
)?;
Expand Down Expand Up @@ -559,7 +559,7 @@ fn select_for_path_element(
state: &mut State,
root_and_current_tables: &RootAndCurrentTables,
relationship: &models::Relationship,
predicate: &Option<Box<models::Expression>>,
predicate: Option<&models::Expression>,
select_list: sql::ast::SelectList,
(join_table, from_clause): (TableNameAndReference, sql::ast::From),
) -> Result<sql::ast::Select, Error> {
Expand Down
9 changes: 3 additions & 6 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions nix/docker.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
, lib
, package
, image-name
, pkgs
, architecture ? null
, tag ? null # defaults to the output hash
, extraConfig ? { } # see config options at: https://github.com/moby/moby/blob/master/image/spec/v1.2.md#image-json-field-descriptions
Expand All @@ -13,7 +14,7 @@ let
args = {
name = image-name;
created = "now";
contents = [ package ];
contents = [ package pkgs.cacert ];
config = {
Entrypoint = [
"/bin/${package.pname}"
Expand Down Expand Up @@ -44,4 +45,4 @@ let
inherit architecture;
};
in
dockerTools.buildLayeredImage args
dockerTools.buildLayeredImage args
9 changes: 6 additions & 3 deletions rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
[toolchain]
channel = "1.77.2"
profile = "default" # see https://rust-lang.github.io/rustup/concepts/profiles.html
components = ["rust-analyzer", "rust-src"] # see https://rust-lang.github.io/rustup/concepts/components.html
channel = "1.83.0"
profile = "default" # see https://rust-lang.github.io/rustup/concepts/profiles.html
components = [
"rust-analyzer",
"rust-src",
] # see https://rust-lang.github.io/rustup/concepts/components.html

0 comments on commit 205ecee

Please sign in to comment.