Coder Social home page Coder Social logo

Comments (5)

kakalos12 avatar kakalos12 commented on September 28, 2024 1

ok @weiznich , Let me try it.

from diesel.

weiznich avatar weiznich commented on September 28, 2024

Thanks for opening this bug report.

Seems like it's just missing the BigDecimal type in this list of allowed types:

const NUMERIC_TYPES: &[&str] = &[

Mind submitting a PR that adds it there + adds a test somewhere in diesel_test

from diesel.

kakalos12 avatar kakalos12 commented on September 28, 2024

Hi @weiznich , Sorry, I'm new to rust, Can you guide me how to setup the working env for the diesel. When I clone the repository to my local machine and try to run cargo t, it has some errors

error[E0432]: unresolved import `diesel`
  --> diesel/src/expression/functions/date_and_time.rs:30:1
   |
30 | / define_sql_function! {
31 | |     /// Represents the SQL `DATE` function. The argument should be a Timestamp
32 | |     /// expression, and the return value will be an expression of type Date.
33 | |     ///
...  |
50 | |     fn date(expr: Timestamp) -> Date;
51 | | }
   | |_^ could not find `sqlite` in the crate root
   |
   = note: this error originates in the macro `define_sql_function` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0432]: unresolved import `diesel`
  --> diesel/src/sql_types/mod.rs:40:48
   |
40 | #[derive(Debug, Clone, Copy, Default, QueryId, SqlType)]
   |                                                ^^^^^^^ could not find `pg` in the crate root
   |
   = note: this error originates in the derive macro `SqlType` (in Nightly builds, run with -Z macro-backtrace for more info)

Thanks so much.

from diesel.

weiznich avatar weiznich commented on September 28, 2024

It depends a bit on where exactly you've called cargo test, but in general you always need to set some feature flags to enable one or the other backend. The contribution documentation has some more details and there is the bin/test script which executes most of the tests in the repo.

For the diesel crate itself you usually want something like DATABASE_URL=… cargo test --features "{backend_to_test} extras" where {backend_to_test} is one of postgres, mysql or sqlite.

from diesel.

weiznich avatar weiznich commented on September 28, 2024

Fixed by #4102

from diesel.

Related Issues (20)

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.