Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ tree_magic = "0.2"
base64 = "0.9"
geo = "0.4"
time = "0.1.14"
rustorm_dao = "0.4.0"
rustorm_codegen = "0.3.0"
rustorm_dao = { path = "crates/dao" }
rustorm_codegen = { path = "crates/codegen" }
r2d2_mysql = {version = "16.0.0", optional = true}
thiserror = "1.0.3"

Expand All @@ -54,9 +54,3 @@ with-postgres = ["postgres", "r2d2_postgres", "postgres-shared"]
with-sqlite = ["rusqlite","r2d2_sqlite"]
with-mysql = ["r2d2_mysql"]


# Needed to be here since rustorm is tested as one project
# in the ci instead of part of diwata
[replace]
"rustorm_dao:0.4.0" = { path = "crates/dao" }
"rustorm_codegen:0.3.0" = { path = "crates/codegen" }
8 changes: 6 additions & 2 deletions crates/dao/src/value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ use crate::{
interval::Interval,
ConvertError,
};
use bigdecimal::{BigDecimal, ToPrimitive};
use bigdecimal::{
BigDecimal,
ToPrimitive,
};
use chrono::{
DateTime,
NaiveDate,
Expand Down Expand Up @@ -169,6 +172,7 @@ impl_from!(Uuid, Uuid);
impl_from!(NaiveDate, Date);
impl_from!(NaiveTime, Time);
impl_from!(DateTime<Utc>, Timestamp);
impl_from!(NaiveDateTime, DateTime);

impl<'a> From<&'a str> for Value {
fn from(f: &'a str) -> Value { Value::Text(f.to_string()) }
Expand Down Expand Up @@ -265,7 +269,7 @@ impl<'a> TryFrom<&'a Value> for String {
String::from_utf8(v.to_owned()).map_err(|e| {
ConvertError::NotSupported(format!("{:?}", value), format!("String: {}", e))
})
},
}
_ => {
Err(ConvertError::NotSupported(
format!("{:?}", value),
Expand Down
4 changes: 2 additions & 2 deletions src/table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,9 @@ impl Table {
/// if the table in context is product and the foreign table is category
/// ForeignKey{
/// name: product_category_fkey
/// columns: [category_id]
/// columns: _category_id_
/// foreign_table: category
/// referred_columns: [id]
/// referred_columns: _id_
/// }
#[derive(Debug, PartialEq, Clone)]
pub struct ForeignKey {
Expand Down