New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Insert json in to postgres, How? #1310

Closed
greenpdx opened this Issue Nov 25, 2017 · 1 comment

Comments

Projects
None yet
2 participants
@greenpdx

greenpdx commented Nov 25, 2017

Setup

Versions

  • Rust: 1.21.0
  • Diesel: 0.16.0
  • Database: postgres 9.5.10
  • Operating System Linux ubuntu 16.04

Feature Flags

  • diesel: postgres serde_json
  • diesel_codegen: posgres

Problem Description

#[derive(Insertable,Debug)]
#[table_name="tst1"]
pub struct NewTst<'a> {
    pub js: &'a Json,
}

insertable error

What are you trying to accomplish?

Trying to insert json into postgres and read json.

What is the expected output?

What is the actual output?

Are you seeing any additional errors?

Steps to reproduce

https://github.com/greenpdx/jsonrpc_diesel

Checklist

  • [x ] I have already looked over the issue tracker for similar issues.
@weiznich

This comment has been minimized.

Contributor

weiznich commented Nov 25, 2017

Use serde_json::Value instead of that Json type.

@weiznich weiznich closed this Nov 25, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment