Comments (8)
It would be much more useful to run tests on MySQL 5.7 instead of MySQL 8. Examples are not very representative.
from bun.
Yes, I think we need something like #50 (not tested)
from bun.
Examples use sqlite in-memory database that allows you to run the examples without the need for external database dependency. Additionally, since Bun works with any SQL database that has a go driver and dialect for it, only initialization is different between databases. And that could be as little as two lines of code.
- sqldb, err := sql.Open("sqlite3", ":memory:?cache=shared")
+ sqldb, err := sql.Open("mysql", "root:pass@/test")
- db := bun.NewDB(sqldb, sqlitedialect.New())
+ db := bun.NewDB(sqldb, mysqldialect.New())
There is no practical use here for using mysql database for examples.
from bun.
As @Codebreaker101 correctly guessed, SQLIte was chosen so you can run examples without configuring anything and/or running a Docker container. Also it seems more fair this way for PostgreSQL users :)
But the tests are run for all 3 supported databases - https://github.com/uptrace/bun/blob/master/internal/dbtest/db_test.go#L26-L73
from bun.
If bun want to be cross database and be widely used, MySQL and PostgreSQL is our must support.
Consider that, bun is migrated from go-pg, bun with PostgreSQL is good enough.
However, bun with MySQL (special 5.7) has many bugs.
So, write examples with MySQL brings more help.
from bun.
@vmihailenco do we have any plan to add MySQL 5.7 to internal/dbtest
.
from bun.
i run internal/dbtest in my local env, mysql prior version 8.0:
- does not support CTE
- does not support
where
withoutfrom
:SELECT 1 WHERE TRUE
is syntax error. - notice system variable: explicit_defaults_for_timestamp
- TIMESTAMP/DATETIME does not support time zone #48 , this block our usage with MySQL 5.7
from bun.
All should be fixed in master. Tests that use CTE are skipped on MySQL 5.
from bun.
Related Issues (20)
- When the original SQL query and scan are used, there will be garbled characters.
- model tag "alt" don't work HOT 1
- nullzero relations not being fetched HOT 2
- Multiple joins not deserializing correctly
- TrunateTableQuery: missing ModelTableExpr() method
- Postgres update join not working HOT 1
- How to handle logical names of columns that are too long? HOT 1
- Model() w/o params in doc?
- [bug] Query Select uses wrong table name when ModelTableExpr is called HOT 2
- I want to be able to use PostgreSQL's parametric placeholders.
- inconsistent behavior for ModelTableExpr (select <--> create/insert/update/delete)
- race detected in ```schema.Field.Clone()``` HOT 2
- Issue with BeforeAppendModel when selecting columns to update HOT 1
- Go migrations are not discovered
- Custom sum column on a relation
- In v1.2, about 'unique' tag option in embedded structures HOT 1
- Call BeforeAppendModel on embedded types
- incorrect CTE generation
- Is []int64 supported for Arrays
- Support for DuckDB dialect
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bun.