Giter VIP home page Giter VIP logo

cdrs-helpers-derive's Introduction

Hi there ๐Ÿ‘‹

  • ๐Ÿ”ญ Iโ€™m currently working on:
    • Rasmus - standalone WebAssembly engine.
    • TeleMQ - MQTT broker

cdrs-helpers-derive's People

Contributors

alexpikalov avatar jasperav1994 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

jasperav krojew

cdrs-helpers-derive's Issues

Trying to use TryFromRow reuslts in error

When attempting to use the TryFromRow derive macro, the Rust compiler will complain about "expected trait, found derive macro "TryFromRow" not a trait [E0404].

Rust Version: 1.46.0
Crate Version: 0.3.3
cdrs Crate Version: 2.3.3

Example:
#[path = "./common.rs"]
mod common;
use cdrs_helpers_derive::*;
use common::UniqueId;
use juniper::GraphQLObject;

//#[derive(Clone, Debug, GraphQLObject, IntoCDRSValue, TryFromRow)]
#[derive(TryFromRow)]
#[graphql(description = "An account in the global system")]
pub struct Entity {
pub uid: String,
pub sid: String,
pub display_name: String,
}

impl UniqueId for Entity {
fn uid(&self) -> &str {
&self.uid
}
}

impl Entity {
fn sid(&self) -> &str {
&self.sid
}

fn display_name(&self) -> &str {
    &self.display_name
}

}

pub struct NewEntity<'a> {
pub sid: &'a str,
pub display_name: &'a str,
}

pub struct NewEntityInput {
pub sid: String,
pub display_name: String,
}

panic: General("List should not be empty") when using SELECT, INSERT is fine

Have a problem with nested UDT SELECT query (INSERT is fine, verified data with cqlsh shell).

I use scylla database.

From backtrace looks like this place panics

macro_rules! list_as_rust {
    ($($into_type:tt)+) => (
        impl AsRustType<Vec<$($into_type)+>> for List {
            fn as_rust_type(&self) -> Result<Option<Vec<$($into_type)+>>> {
                match self.metadata.value {
                    Some(ColTypeOptionValue::CList(ref type_option)) |
                    Some(ColTypeOptionValue::CSet(ref type_option)) => {
                        let type_option_ref = type_option.as_ref();
                        let convert = self
                            .map(|bytes| {
                                as_rust_type!(type_option_ref, bytes, $($into_type)+)
                                    .unwrap()
                                    // item in a list supposed to be a non-null value.
                                    // TODO: check if it's true
                                    .unwrap()
                            });

                        Ok(Some(convert))
                    },
                    _ => Err(Error::General(format!("Invalid conversion. \
                            Cannot convert {:?} into List (valid types: List, Set).",
                            self.metadata.value)))
                }
            }
        }
    );
}
                                as_rust_type!(type_option_ref, bytes, $($into_type)+)
                                    .unwrap()
                                    // item in a list supposed to be a non-null value.
                                    // TODO: check if it's true
                                    .unwrap()

.unwrap in particular. Although I don't insert empty list (Vec) I assume it should initialize empty Vec on Rust side or did I misunderstood something?

Update dependencies 'syn', 'quote' & 'proc-macro2' to 1.*

The current dependencies are pretty outdated and some types that are used in this crate are not available anymore in newer versions of the dependencies. There are breaking changes, but the newer versions have features that can be useful.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.