-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c608b10
commit d01959f
Showing
17 changed files
with
96 additions
and
149 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ members = [ | |
] | ||
|
||
[workspace.package] | ||
version = "0.0.2" | ||
version = "0.1.0" | ||
license = "Apache-2.0" | ||
edition = "2021" | ||
authors = ["Mara Schulke <[email protected]>"] | ||
|
@@ -15,8 +15,8 @@ repository = "https://github.com/hemisphere-studio/atmosphere" | |
keywords = ["sqlx", "postgres", "database", "orm", "backend"] | ||
|
||
[workspace.dependencies] | ||
atmosphere-core = { version = "=0.0.2", path = "atmosphere-core" } | ||
atmosphere-macros = { version = "=0.0.2", path = "atmosphere-macros" } | ||
atmosphere-core = { version = "=0.1.0", path = "atmosphere-core" } | ||
atmosphere-macros = { version = "=0.1.0", path = "atmosphere-macros" } | ||
async-trait = "0.1" | ||
lazy_static = "1" | ||
sqlx = { version = "0.7", features = ["chrono"] } | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -65,10 +65,11 @@ async fn main() -> sqlx::Result<()> { | |
|
||
user.save(&pool).await?; | ||
user.delete(&pool).await?; | ||
user.create(&pool).await?; | ||
|
||
// Field Queries | ||
|
||
assert!( | ||
assert_eq!( | ||
User::find(&0, &pool).await?, | ||
User::find_by_email("[email protected]", &pool).await? | ||
); | ||
|
@@ -96,20 +97,7 @@ async fn main() -> sqlx::Result<()> { | |
|
||
Atmosphere introspects the `User` and `Post` structs at compile time and | ||
generates `const` available type information about the schema into the `Table` | ||
trait: | ||
|
||
```rust | ||
impl Table for User { | ||
const SCHEMA: &str = "public" | ||
const TABLE: &str = "user" | ||
const PRIMARY_KEY: Column = Column { name: "id", ty: PrimaryKey, .. }; | ||
const FOREIGN_KEYS: &'static [Column; 0] = &[]; | ||
const DATA: &'static [Column; 2] = &[ | ||
Column { name: "name", ty: Value, .. }, | ||
Column { name: "email", ty: Value, .. } | ||
]; | ||
} | ||
``` | ||
trait. | ||
|
||
## Roadmap | ||
|
||
|
@@ -136,14 +124,14 @@ impl Table for User { | |
- [ ] Stabilize Traits | ||
- [ ] Stabilize Query Generation | ||
- [ ] Table Lenses (subsets / views) | ||
- [ ] `validator` support | ||
- [ ] Auto Timestamping | ||
|
||
### Advanced | ||
- [ ] Virtual Columns using (`#[virtual = "<sql>"]`) | ||
- [ ] Soft Delete Support | ||
- [ ] Attribute Macro (`#[query]`) | ||
- [ ] Custom queries | ||
- [ ] Auto Timestamping | ||
- [ ] `validator` support | ||
|
||
### Longterm | ||
- [ ] Generate GraphQL + HTTP Servers? | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.