Comments (10)
Oh okay I got it now, Billy added it for testing the driver support.
from sea-orm.
Hi @tyt2y3 , I'm not clear about what the task sequential operations
means.
from sea-orm.
So the idea is to have several test cases with several transactions, for example (me just thinking randomly):
- select the baker having the least sales
- create and assign more cakes to him
- create new order based on the the new baker's cakes
- select and verify the result
that is what I mean by 'read, insert / update, read again and update again'
from sea-orm.
Hi @tyt2y3 , thanks for the clarification, I've started to implement this but I have run into the same problem that I was asking about in the discussion area. How can I do a query such as this with the ORM:
SELECT
baker.name, sum(lineitem.price * lineitem.quantity)
FROM
baker
INNER JOIN cakes_bakers ON cakes_bakers.baker_id = baker.id
INNER JOIN cake ON cakes_bakers.cake_id = cake.id
INNER JOIN lineitem ON lineitem.cake_id = cake.id
GROUP BY
baker.name;
I don't seem to be able to do multiple joins in one query (for example baker::Entity::find().left_join(cake::Entity) .left_join(lineitem::Entity)
) and I haven't been able to find a similar case in the codebase so I'm a bit stuck.
from sea-orm.
There is another method in query/helper.rs
fn join(mut self, join: JoinType, rel: RelationDef) -> Self {
self.query()
.join(join, rel.to_tbl.clone(), join_condition(rel));
self
}
That does not require a Related trait
from sea-orm.
Thanks, got it working now.
from sea-orm.
We'd want to refactor our test suite and test for Postgres & SQLite
- generalize
setup()
function to obtain database url from env - extract & generalize any MySQL specific code
- make the test suite passes on Postgres
- (if no database url passed in from env, fallback to an in memory SQLite database)
make the test suite passes on SQLite
from sea-orm.
@samsamai can you explain what the file pg_tests
is for?
Is it duplicate of bakery_chain_tests
?
from sea-orm.
@tyt2y3 pg_tests was done by @billy1624 for when he was working on the pg_driver I think.
from sea-orm.
Thank you so much for the great work indeed!
from sea-orm.
Related Issues (20)
- Missing primary_key attributes when generating from a DB with partitions HOT 2
- doc: code blocks looks weird in light mode HOT 7
- Incorrect Route Matching Behavior in Actix Example Code HOT 1
- no column found for name: A_
- Missing okapi support HOT 1
- Insert to mysql, can find data inserted in mysql but the method returns with Err(RecordNotFound("Failed to find inserted item")).
- Issues with tables that do not have primary/unique keys
- Insert an active model and get back the last insert id doesn't work with autoincrement
- Enum column named "model" generates code that conflicts with the struct Model
- ambiguous associated type when access Entity::Column HOT 5
- TimestampWithTimeZone returned as array
- Allow Defaulting `string_value` For ActiveEnum Based On Renaming Rules On Variants HOT 1
- transaction use probelm with state
- Sea-ORM still includes sqlx-mysql dependency even when no mysql feature is enabled
- sea-orm-migration - Compile error using most recent version of rc2 HOT 12
- Missing downward feature `runtime-tokio`. HOT 4
- Mock Auto Increment ID Not Working for Postgres Backend Complaining About Null HOT 1
- sea-orm-cli generate error HOT 1
- .money_len type creates invalid SQL HOT 1
- Compilation error when building with sqlx-sqlite and runtime-async-std-rustls HOT 3
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 sea-orm.