Giter Site home page Giter Site logo

orca-zhang / borm Goto Github PK

View Code? Open in Web Editor NEW
119.0 11.0 19.0 182 KB

【🔥今日热门】🏎️ 更好的ORM库 (Better ORM library that is simple, fast and self-mockable for Go)

License: MIT License

Go 100.00%
golang orm reflect2 sql-like fast simple self-mockable crud gorm xorm

borm's Introduction

Simplified Chinese README | 简体中文说明

My Masterpieces

This is a Beef Wellington I learned to make in 2022. My small dream is to open a Wuxi snack shop, selling bubble wontons, small steamed buns, magnolia cakes, hot and sour soup, and Suzhou-style noodles.

  • 🐋[orcas] 🗄️Lightweight NAS solution that is smarter and more modern. (WIP)
    • 💸 Low cost: 3D print hot-swappable backplane reduce costs to 25%, ultra-high-performance system only costs ¥745.6 (without disk), 3~18TB PMR storage only costs ¥1225.6~3115.6
    • 🚧 Cross-platform: Supports Win, Linux, MacOSX and (RPi / ARM64) with only 30W for 6 disks
    • 📚 Replaceable storage engine: Default sqlcipher + self-developed storage
    • 📤 Supports multiple access protocols: http1.1/http2.0/http3.0/nfs/smb
  • ❄️[idgen] A snowflake algorithm ID generator
    • 🚀 Supports redis-based or local memory (fallback on failure)
    • ⌚ NTP synchronization and secure clock rollback (default 1 minute)
    • 🦖 JS precision security (not exceeding 53 bits)
  • 🦄[ecache] Lightweight local memory cache
    • 🤏 Less than 300 LOC, ready to be integrated in 30s
    • 🚀 High performance, minimalist design, concurrency safe
    • 🌈 Supports LRU and LRU-2 modes
    • 🦖 Additional components support distributed consistency
  • 🏎️[borm] A better ORM library
    • Similar to writing SQL, almost no learning overhead. The C++ version (not yet open-sourced) can handle data load/store from db to pb/struct in one line . The Go version uses reflect2 to solve type conversion pain points, with performance close to or slightly better than native, and has been used in production environments of two listed companies without bugs for many years.
  • 🗂️[LRUCache(go / c++ / js)]
    • Implementations in three languages, all beats 100% in leetcode. The C++ version cleverly avoid copying by overloading the key, with powerful performance.
  • 🐞[emock] Next-generation mock library
    • Comparable to Google's googlemock, cross-platform support for mocking all functions (all 6 kinds of functions), with one macro handling everything. Unique solution of windows pdb file overload symbol matching algorithm, reflection-like, API Hook principle implementation, and the only one trampoline safe on the Internet.
  • 🚀[xpjson] Mini cross-platform json library
    • Born in 2013, implemented with C++11 & template metaprogramming (TMP, type extraction) techniques, only 1500 lines, no external dependencies, support SSO (Small String Optimization)/COW (Copy On Write)
  • 💜[influxdb] The most popular C and C++ client on GitHub
    • Less than 300 LOC to decode HTTP requests, with no dependencies, cleverly using Duff's device to merge processing ordinary and chunked returns
  • 💉[yapi] yet another process injector
    • Eliminate the difference between x86/x64/wow64 under Windows, injects the target process just like writing a local program, and no longer requires dll support
  • 🔓[unlocker] Ring3 layer (user mode, non-driver) file unlocking library
    • Possibly the unique non-violent solution in the world to unlock malformed directory deletion (this solution cannot be found on the Internet), the unique memory-mapped file unlocking method (the association between handle and mapfile has a fault line), supports cross-x86/x64/wow64 operations, supports skipping pipelines and other special handles that may cause deadlock
  • 🔍[ezpp] A very easy-to-use C++ code-level performance profiler with online profiling
    • The only one to support recursion and multithreading (compared to Google gprofiler and Intel VTune), widely used internally by the company, and has resulted in performance optimization contributions many times
  • 🔲[jsqrcode] Pure JS version QR code parsing library (zxing port)
    • Several bugs fixed, added support for Japanese code table/Chinese character decoding (loaded on demand), greatly improved decoding success rate
  • 🆙[AutoUpdate] Automatic update module implemented based on MFC
    • Minimalist design (only bubble interaction), multilingual support, self-update, multiple update strategies, multi-node deployment, full-screen detection, and provided SDK plug-and-play

Top LangsStats

borm's People

Contributors

orca-zhang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

borm's Issues

OnDuplicatekey Map Loop unstable

BuildSQL 和 BuildArgs
在分两次遍历了arg里面的同一个map 每次map遍历不能保证用稳定顺序输出
最后执行的语句里预处理语句和参数就可能不对称

[problem line]

app/common/live/library/borm/borm.go:544

// on duplicate key update
for _, arg := range args {
    arg.BuildSQL(&sb)
    arg.BuildArgs(&stmtArgs)
}

很好,很强大,比 gorm 注重细节

gorm的问题在于,Where里面放了map[string]interface{}好像会引用错地址,然后多AND条件没有做优先级处理,比如a and b and c他的结果是a and (b and c),而borm不光处理好了这个优先级,还能自动判定什么时候要加括号!仅有在and和or同时出现,且与不加括号时的隐式优先级不一致的时候!

sqlite3 语法差异记录

orcas 在使用sqlite3+borm过程中发现一些差异:

  • INSERT IGNORE INTO -> INSERT OR IGNORE INTO
  • FORCE INDEX(idx_name) -> INDEXED BY idx_name
  • ON DUPLICATE KEY UPDATE field1=value1, field2=value2... -> ON CONFLICT(field) DO UPDATE SET field1=value1, field2=value2...
  • 支持*?的模式匹配GLOB(field, matcher)
  • UPDATE/DELETE语句不能添加LIMIT约束
  • LIMIT 2,3 -> LIMIT 3 OFFSET 2

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.