Skip to content

Commit

Permalink
order extensions by name asc (#269)
Browse files Browse the repository at this point in the history
Co-authored-by: Ian Stanton <ian@coredb.io>
  • Loading branch information
ryw and ianstanton authored Jul 25, 2023
1 parent 284cccc commit e17f471
Show file tree
Hide file tree
Showing 3 changed files with 84 additions and 72 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/registry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ jobs:
- 5432:5432
steps:
- uses: actions/checkout@v3
- name: Install minimal nightly with clippy and rustfmt
- name: Install minimal stable with clippy and rustfmt
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
toolchain: stable
components: rustfmt, clippy
- name: Install system dependencies
run: |
Expand All @@ -65,7 +65,7 @@ jobs:
with:
prefix-key: "lint"
- name: Cargo format
run: cargo +nightly fmt --all --check
run: cargo fmt --all --check
- name: Run migrations
run: cargo sqlx migrate run
- name: Migrations check
Expand Down
148 changes: 80 additions & 68 deletions registry/sqlx-data.json
Original file line number Diff line number Diff line change
Expand Up @@ -424,72 +424,6 @@
},
"query": "\n INSERT INTO versions(extension_id, num, created_at, yanked, license, published_by)\n VALUES ($1, $2, (now() at time zone 'utc'), $3, $4, $5)\n "
},
"48a96a05f91d89cfd30f0cd3b119f0690a53d71d82ad9d40a5b0a07941fc31c9": {
"describe": {
"columns": [
{
"name": "id",
"ordinal": 0,
"type_info": "Int8"
},
{
"name": "name",
"ordinal": 1,
"type_info": "Varchar"
},
{
"name": "updated_at",
"ordinal": 2,
"type_info": "Timestamptz"
},
{
"name": "created_at",
"ordinal": 3,
"type_info": "Timestamptz"
},
{
"name": "downloads",
"ordinal": 4,
"type_info": "Int4"
},
{
"name": "description",
"ordinal": 5,
"type_info": "Varchar"
},
{
"name": "homepage",
"ordinal": 6,
"type_info": "Varchar"
},
{
"name": "documentation",
"ordinal": 7,
"type_info": "Varchar"
},
{
"name": "repository",
"ordinal": 8,
"type_info": "Varchar"
}
],
"nullable": [
false,
true,
false,
false,
true,
true,
true,
true,
true
],
"parameters": {
"Left": []
}
},
"query": "SELECT * FROM extensions"
},
"49a41631cfe21efe58022e6e4026e6f3d388d8bb12ac478dbf30addab78d430e": {
"describe": {
"columns": [
Expand Down Expand Up @@ -739,6 +673,11 @@
"name": "links",
"ordinal": 12,
"type_info": "Varchar"
},
{
"name": "postgres_version",
"ordinal": 13,
"type_info": "Int4"
}
],
"nullable": [
Expand All @@ -754,7 +693,8 @@
true,
true,
true,
true
true,
false
],
"parameters": {
"Left": [
Expand All @@ -765,6 +705,72 @@
},
"query": "SELECT *\n FROM versions\n WHERE \n extension_id = $1\n and num = $2"
},
"7cc69acf039075253b7224f17a7038e9f25d9974875b2d0d3c75983afc2c77fb": {
"describe": {
"columns": [
{
"name": "id",
"ordinal": 0,
"type_info": "Int8"
},
{
"name": "name",
"ordinal": 1,
"type_info": "Varchar"
},
{
"name": "updated_at",
"ordinal": 2,
"type_info": "Timestamptz"
},
{
"name": "created_at",
"ordinal": 3,
"type_info": "Timestamptz"
},
{
"name": "downloads",
"ordinal": 4,
"type_info": "Int4"
},
{
"name": "description",
"ordinal": 5,
"type_info": "Varchar"
},
{
"name": "homepage",
"ordinal": 6,
"type_info": "Varchar"
},
{
"name": "documentation",
"ordinal": 7,
"type_info": "Varchar"
},
{
"name": "repository",
"ordinal": 8,
"type_info": "Varchar"
}
],
"nullable": [
false,
true,
false,
false,
true,
true,
true,
true,
true
],
"parameters": {
"Left": []
}
},
"query": "SELECT * FROM extensions order by name asc"
},
"7d372fca1ed8b3cd12573033e0329361636b95ffb41b9e13be2844755ab37a75": {
"describe": {
"columns": [
Expand Down Expand Up @@ -832,6 +838,11 @@
"name": "links",
"ordinal": 12,
"type_info": "Varchar"
},
{
"name": "postgres_version",
"ordinal": 13,
"type_info": "Int4"
}
],
"nullable": [
Expand All @@ -847,7 +858,8 @@
true,
true,
true,
true
true,
false
],
"parameters": {
"Left": [
Expand Down
2 changes: 1 addition & 1 deletion registry/src/routes/extensions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ pub async fn get_all_extensions(

// Create a database transaction
let mut tx = conn.begin().await?;
let rows = sqlx::query!("SELECT * FROM extensions")
let rows = sqlx::query!("SELECT * FROM extensions order by name asc")
.fetch_all(&mut tx)
.await?;
for row in rows.iter() {
Expand Down

0 comments on commit e17f471

Please sign in to comment.