Skip to content

Commit

Permalink
[SeaORM-X] edit
Browse files Browse the repository at this point in the history
  • Loading branch information
billy1624 committed Apr 16, 2024
1 parent 74645a0 commit 1511f22
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 1 deletion.
15 changes: 15 additions & 0 deletions SeaORM-X/src/components/HomepageExample.js
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,21 @@ fruit::Entity::delete_many()
.exec(db)
.await?;`
},
{
title: 'Identity Insert',
code: `// Insert an active model with a specific primary key value.
// For MSSQL, SeaORM X will automatically enable \`IDENTITY INSERT\` when inserting a row with primary key value,
// and then disable the \`IDENTITY INSERT\` once the insert finished.
let pear = fruit::ActiveModel {
id: Set(1),
name: Set("Pear".to_owned()),
cake_id: NotSet,
};
// \`IDENTITY INSERT\` behind the hood
let pear: fruit::Model = pear.insert(db).await?;`
},
{
title: 'Nested Transaction',
code: `assert_eq!(Bakery::find().all(txn).await?.len(), 0);
Expand Down
24 changes: 24 additions & 0 deletions SeaORM-X/src/components/HomepageWaitingList.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import React from 'react';
import clsx from 'clsx';
import styles from './HomepageWaitingList.module.css';
import Link from '@docusaurus/Link';

export default function render() {
return (
<section className={clsx('home-section', 'home-section-alt', styles.features)}>
<div className="container">
<div className="row">
<div className={clsx('col col--12')}>
<div className={styles.buttons}>
<Link
className="button button--primary button--lg"
to="https://forms.office.com/r/1MuRPJmYBR">
Request Access
</Link>
</div>
</div>
</div>
</div>
</section>
);
}
7 changes: 7 additions & 0 deletions SeaORM-X/src/components/HomepageWaitingList.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/* stylelint-disable docusaurus/copyright-header */

.buttons {
display: flex;
align-items: center;
justify-content: center;
}
4 changes: 3 additions & 1 deletion SeaORM-X/src/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import HomepageExample from '../components/HomepageExample';
import HomepageCompare from '../components/HomepageCompare';
import HomepageProducts from '../components/HomepageProducts';
import HomepageSponsors from '../components/HomepageSponsors';
import HomepageWaitingList from '../components/HomepageWaitingList';
import HomepageMascot from '../components/HomepageMascot';

function HomepageHeader() {
Expand All @@ -23,7 +24,7 @@ function HomepageHeader() {
<Link
className="button button--primary button--lg"
to="/docs/index">
Getting Started
Documentation
</Link>
</div>
</div>
Expand All @@ -43,6 +44,7 @@ export default function Home() {
{/* <HomepageCompare /> */}
{/* <HomepageProducts /> */}
{/* <HomepageSponsors /> */}
<HomepageWaitingList />
<HomepageMascot />
</main>
</Layout>
Expand Down

0 comments on commit 1511f22

Please sign in to comment.