GithubHelp home page GithubHelp logo

Common field processing issues about rbatis HOT 2 OPEN

TTTq avatar TTTq commented on June 15, 2024
Common field processing issues

from rbatis.

Comments (2)

zhuxiujia avatar zhuxiujia commented on June 15, 2024

Hello author, I'm not sure if it's possible to add a universal structure processing method. I encountered a problem while using it. I put the common fields create_time, create_id, update_time, and update_id in a BaseModel structure and used them in the structure I'm using. However, when querying the returned value, I won't be able to retrieve and map all the values in this BaseMode structure to the corresponding base field. Is there a solution like this? ` pub struct BaseModel { pub create_time: Option, pub create_id: Option, pub update_time: Option, pub update_id: Option, }

pub struct SubModel{ pub base: Option, pub user_name: Option, pub real_name: Option, pub available: Option, } `

see https://github.com/rbatis/rbatis/blob/master/example/src/table_extend.rs

from rbatis.

TTTq avatar TTTq commented on June 15, 2024

Thinks! But I encountered another plugin executing the modified SQL, and at the end of the execution, it was not the modified SQL, but the SQL before the modification. May I ask why this is?
image
image

from rbatis.

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.