Coder Social home page Coder Social logo

Comments (4)

guotie avatar guotie commented on August 16, 2024

还有,两种query,一种返回多个值,一种返回一个值,对应于go sql的query和queryrow可以区分对待吗?
queryrow类似于k-v数据库的get操作,更容易实现上面的功能

from xorm.

lunny avatar lunny commented on August 16, 2024

你说的是lazy update,是更新缓存的一种策略,目前没有去实现;目前只有查询缓存,所有的更新操作是更新到缓存的同时立即更新到数据库。  原始邮件  发件人: [email protected]收件人: lunny/[email protected]发送时间: 2013年12月17日(周二) 15:51主题: [xorm] 内部的缓存能不能实现自动倒回到表里的功能? (#34)比如一个post,这个post的点击次数,回复次数两个字段可能是经常被更新的,如果我把这个post读入缓存中,设置一个自动更新时间,时间到了以后,自动的updtae数据库。

—Reply to this email directly or view it on GitHub.

from xorm.

lunny avatar lunny commented on August 16, 2024

func (db *DB) QueryRow(query string, args ...interface{}) *Row { rows, err := db.Query(query, args...)
return &Row{rows: rows, err: err}
}看一下标准库中QueryRow的实现,其实就是Query的一个简单封装。在xorm里面,获取单条记录用engine.Get(),多条记录用engine.Find()。  原始邮件  发件人: [email protected]收件人: lunny/[email protected]发送时间: 2013年12月17日(周二) 15:59主题: Re: [xorm] 内部的缓存能不能实现自动倒回到表里的功能? (#34)还有,两种query,一种返回多个值,一种返回一个值,对应于go sql的query和queryrow可以区分对待吗?
queryrow类似于k-v数据库的get操作,更容易实现上面的功能

—Reply to this email directly or view it on GitHub.

from xorm.

lunny avatar lunny commented on August 16, 2024

暂时无法实现。

from xorm.

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.