~sircmpwn/godocs.io

gddo: internal/database: Order packages by import path v1 APPLIED

Adnan Maolood: 1
 internal/database: Order packages by import path

 1 files changed, 6 insertions(+), 3 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~sircmpwn/godocs.io/patches/22559/mbox | git am -3
Learn more about email & git
View this thread in the archives

[PATCH gddo] internal/database: Order packages by import path Export this patch

---
Instead of leaving the order undefined.

 internal/database/database.go | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/internal/database/database.go b/internal/database/database.go
index 57deab1..3f7071a 100644
--- a/internal/database/database.go
+++ b/internal/database/database.go
@@ -432,7 +432,8 @@ func (db *Database) Importers(ctx context.Context, importPath string) ([]Package
			FROM packages p, importers i
			WHERE i.import_path = $1 AND
				p.import_path = i.importer_path AND
				p.version = i.importer_version;
				p.version = i.importer_version
			ORDER BY p.import_path;
			`, importPath)
		if err != nil {
			return err
@@ -506,7 +507,8 @@ func (db *Database) ModulePackages(ctx context.Context, modulePath, version stri
			SELECT
				import_path, series_path, commit_time, name, synopsis
			FROM packages
			WHERE module_path = $1 AND version = $2;
			WHERE module_path = $1 AND version = $2
			ORDER BY import_path;
			`, modulePath, version)
		if err != nil {
			return err
@@ -538,7 +540,8 @@ func (db *Database) SubPackages(ctx context.Context, modulePath, version, import
			SELECT
				import_path, series_path, commit_time, name, synopsis
			FROM packages
			WHERE module_path = $1 AND version = $2 AND import_path LIKE $3 || '_%';
			WHERE module_path = $1 AND version = $2 AND import_path LIKE $3 || '_%'
			ORDER BY import_path;
			`, modulePath, version, importPath)
		if err != nil {
			return err
-- 
2.31.1
Thanks!

To git@git.sr.ht:~sircmpwn/gddo
   6b2523d..3f3be90  master -> master