by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Mar 06 02:38
    XHang synchronize #64
  • Oct 23 2019 14:19

    lunny on master

    Update README.md Update README.md Update SUMMARY.md and 1 more (compare)

  • Oct 23 2019 14:19
    lunny closed #21
  • Oct 23 2019 13:21
    Aviortheking edited #21
  • Oct 23 2019 13:20
    Aviortheking synchronize #21
  • Oct 23 2019 13:18
    Aviortheking synchronize #21
  • Oct 23 2019 13:14
    Aviortheking opened #21
  • Oct 15 2019 08:57

    lunny on master

    Update go get URL and Tags Merge pull request #20 from Des… (compare)

  • Oct 15 2019 08:57
    lunny closed #20
  • Oct 15 2019 08:55
    Desdemo opened #20
  • Oct 15 2019 08:27

    lunny on master

    Update go get URL Merge pull request #16 from Des… (compare)

  • Oct 15 2019 08:27
    lunny closed #16
  • Oct 15 2019 08:25
    Desdemo opened #16
  • Oct 09 2019 09:22
    lunny closed #15
  • Oct 09 2019 09:22
    lunny commented #15
  • Oct 09 2019 08:33
    ayanamist opened #15
  • Sep 28 2019 00:13
    lunny closed #4
  • Sep 28 2019 00:13

    lunny on master

    Delete returns two values Merge pull request #19 from Ily… (compare)

  • Sep 28 2019 00:13
    lunny closed #19
  • Sep 27 2019 13:24
    Ilya33 opened #19
Thomas Boerger
@tboerger
queries for such simple cases? =)
Lunny Xiao
@lunny
I think this is clear and simple than gorm. :)
Thomas Boerger
@tboerger
maybe i just took a bad example ;)
Thomas Boerger
@tboerger
oh... tidb doesnt work... it's not enabled
Lunny Xiao
@lunny
tidb now is work. @tboerger
Thomas Boerger
@tboerger
thanks
Thomas Boerger
@tboerger
@lunny Join needs a proper handling for parameter substitution like accepting the flexible conditions. https://github.com/gogits/gogs/blob/master/models/issue.go#L550-L564 looks pretty poor
something like that would be much cleaner:
labelIDs := base.StringsToInt64s(strings.Split(opts.Labels, ","))

if len(labelIDs) > 0 {
  validJoin := false
  cond := x.Where("issue.id=issue_label.issue_id")

  for _, id := range labelIDs {
    if id == 0 {
      continue
    }

    validJoin = true
    cond.Where("issue_label.label_id = ?", id)
  }

  if validJoin {
    sess.Join("INNER", "issue_label", cond)
  }
}
Lunny Xiao
@lunny
Yes. You are right. I will implement it ASAP.
Lunny Xiao
@lunny
@tboerger join parameters supported.
Thomas Boerger
@tboerger
Cool
Thomas Boerger
@tboerger
@lunny can you also add a clone function to session to get a new session with the same conditions and joins?
Lunny Xiao
@lunny
How about
func MyCondtion() *xorm.Session {
    return x.Where(…).And(..)
}
MyCondtion().Get()
MyCondtion().Find()
Thomas Boerger
@tboerger
that's currently the only way. IMHO clone should be even better :)
Lunny Xiao
@lunny
Could you give me the example about how will you use it? I don’t think we need clone.
Thomas Boerger
@tboerger
sess := x.Where().And().And().In().Join()
countAll, _ := sess.Clone().Count(&Issue{})
err := sess.And().Or().Find(&issues)
@lunny something like that
and for the case of gogs i think about something like:
sess := x.Where().And().And().In().Join()
openResult, _ := sess.Clone().And("issue.is_closed = ?", false).Count(&Issue{})
closedResult, _ := sess.And("issue.is_closed = ?", true).Count(&Issue{})
Lunny Xiao
@lunny
Yes. I will try to implement it.
Thomas Boerger
@tboerger
thank you very much!
Lunny Xiao
@lunny
You are welcome. :)
Victor Gaydov
@gavv
Hi, just found qb which have an interesting query builder
Debraj Manna
@debraj-manna
I am currently a facing big problem in my connection pooling, which is as follows.
I have set the SetMaxIdleConnection 5 and SetMaxOpenConnection 50, but still, I could see in a normal load, a number of persistent open connections are 120 with checking ESTABLISHED state as per follows.

app 8747 10568 sandeshsharma 16u IPv4 691032 0t0 TCP 127.0.0.1:57337->127.0.0.1:mysql (ESTABLISHED)

I wonder if I have set the max idle and max open then why it's reaching till 120, and I have seen if same time if I would close the MySQL connections count to remain at 120 with the following state.

app 8747 10844 sandeshsharma 38u IPv4 505058 0t0 TCP 127.0.0.1:54160->127.0.0.1:mysql (CLOSE_WAIT)
evalphobia
@evalphobia
How is the connection status of mysql processlist?
$ watch -n1 "mysql -h <mysql host> -u <mysql user> -p -e 'show processlist';"
Debraj Manna
@debraj-manna
At the sql process list I am seeing the same number as I specified in maxIdleConnection and maxOpenConnection
but then why I am seeing so much tcp connection from the app to msysql.
Is it like if I specify maxOpenConnection in mysql 5 via xorm but my app let' say makes request to mysql via xorm then will the 95 connections connections be waiting in TCP Connection established state (as mysql will only allow 5)?
Lunny Xiao
@Iunny
I am quitting
Bo-Yi Wu
@appleboy
haha
Lunny Xiao
@lunny
en. it’s a fake user
Bo-Yi Wu
@appleboy
I != l haha
farhanahmedsyed
@farhanahmedsyed
I am not able to do update with join, can you tell me the way here is my current query
UPDATE t
SET t.Payable ='Y', t.advised_billing =
(CASE
WHEN t.service_address_state ='TX' and T.PARTNER_ID in (17,1) and r.promo_code in ('skyline','SKYLINE','APEX-DTD','apex-dtd') THEN 88
WHEN t.service_address_state ='TX' and T.PARTNER_ID in (17,1)
END)
from vpay.WR_New_Pay_File t
LEFT JOIN response r on r.response_id = t.response_id
WHERE t.partner_id IN (17,1) and t.cne_accept_date >= '1/OCT/2015'
Lunny Xiao
@lunny
Bo-Yi Wu
@appleboy
Good news
Lunny Xiao
@lunny
Yes, so that I will delete gitter from my laptop/mobile sometime.
southrivers
@southrivers
any one here ?
Bo-Yi Wu
@appleboy
Qingshan Luo
@edoger
有人么?
pengmingzengdd01
@pengmingzengdd01
HI
有中国人没?
有人没?
有人没?
user5518
@user5518
Hi, I'm relatively new to Go development and have a question about xorm: Does anyone know if it's relatively easy to build a project with a xorm-mysql connection and later switch to xorm-mssql? Or simply asked: How complicated is it to change the database driver in a project, which uses xorm?
user5518
@user5518
Okay, I saw you moved to discordapp...