From af82fe9cf86d17dc2dbd67a20893001948bc95be Mon Sep 17 00:00:00 2001 From: Juraj Kubelka Date: Fri, 3 Sep 2021 10:23:08 -0400 Subject: [PATCH 1/3] use NeoJSON v17 instead of master - we want to use the same version as in the rest of the GToolkit projects --- BaselineOfP3/BaselineOfP3.class.st | 8 ++++---- BaselineOfP3/package.st | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/BaselineOfP3/BaselineOfP3.class.st b/BaselineOfP3/BaselineOfP3.class.st index 1ee82e3..d5823f5 100644 --- a/BaselineOfP3/BaselineOfP3.class.st +++ b/BaselineOfP3/BaselineOfP3.class.st @@ -36,18 +36,18 @@ Use a login that looks as follows " Class { - #name : #BaselineOfP3, - #superclass : #BaselineOf, + #name : 'BaselineOfP3', + #superclass : 'BaselineOf', #category : 'BaselineOfP3' } -{ #category : #baseline } +{ #category : 'baseline' } BaselineOfP3 >> baselineOf: spec [ spec for: #common do: [ - spec baseline: 'NeoJSON' with: [ spec repository: 'github://svenvc/NeoJSON:master/repository' ]. + spec baseline: 'NeoJSON' with: [ spec repository: 'github://svenvc/NeoJSON:v17/repository' ]. spec baseline: 'ZTimestamp' with: [ spec repository: 'github://svenvc/ztimestamp:master/repository' ]. spec baseline: 'Glorp' with: [ spec repository: 'github://pharo-rdbms/glorp:master/']. spec package: 'P3' with: [ spec requires: #('NeoJSON' 'ZTimestamp') ]. diff --git a/BaselineOfP3/package.st b/BaselineOfP3/package.st index 68b9c52..385b70f 100644 --- a/BaselineOfP3/package.st +++ b/BaselineOfP3/package.st @@ -1 +1 @@ -Package { #name : #BaselineOfP3 } +Package { #name : 'BaselineOfP3' } From 18486100c5404c19615ac4e5967e704f4def89e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrei=20Chi=C8=99?= Date: Wed, 29 Mar 2023 16:30:45 +0200 Subject: [PATCH 2/3] Depend on latest version of NeoJSON [feenkcom/gtoolkit#2645] --- BaselineOfP3/BaselineOfP3.class.st | 10 +++++----- BaselineOfP3/package.st | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/BaselineOfP3/BaselineOfP3.class.st b/BaselineOfP3/BaselineOfP3.class.st index d5823f5..75432ec 100644 --- a/BaselineOfP3/BaselineOfP3.class.st +++ b/BaselineOfP3/BaselineOfP3.class.st @@ -36,18 +36,18 @@ Use a login that looks as follows " Class { - #name : 'BaselineOfP3', - #superclass : 'BaselineOf', - #category : 'BaselineOfP3' + #name : #BaselineOfP3, + #superclass : #BaselineOf, + #category : #BaselineOfP3 } -{ #category : 'baseline' } +{ #category : #baseline } BaselineOfP3 >> baselineOf: spec [ spec for: #common do: [ - spec baseline: 'NeoJSON' with: [ spec repository: 'github://svenvc/NeoJSON:v17/repository' ]. + spec baseline: 'NeoJSON' with: [ spec repository: 'github://svenvc/NeoJSON:master/repository' ]. spec baseline: 'ZTimestamp' with: [ spec repository: 'github://svenvc/ztimestamp:master/repository' ]. spec baseline: 'Glorp' with: [ spec repository: 'github://pharo-rdbms/glorp:master/']. spec package: 'P3' with: [ spec requires: #('NeoJSON' 'ZTimestamp') ]. diff --git a/BaselineOfP3/package.st b/BaselineOfP3/package.st index 385b70f..68b9c52 100644 --- a/BaselineOfP3/package.st +++ b/BaselineOfP3/package.st @@ -1 +1 @@ -Package { #name : 'BaselineOfP3' } +Package { #name : #BaselineOfP3 } From 95e3b1bacdfc30393d6400e4e41fa84ce5fe0a48 Mon Sep 17 00:00:00 2001 From: Sven Van Caekenberghe Date: Sun, 17 Dec 2023 19:34:39 +0100 Subject: [PATCH 3/3] Use information_schema in P3Client #listSchemas and #listTablesInSchema: so that views are included (add type in the result) --- P3/P3Client.class.st | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/P3/P3Client.class.st b/P3/P3Client.class.st index bdd5d71..6b974b0 100644 --- a/P3/P3Client.class.st +++ b/P3/P3Client.class.st @@ -425,7 +425,8 @@ P3Client >> isWorking [ { #category : #convenience } P3Client >> listDatabases [ - "Return the list of known database names" + "Return the list of known database names. + I can only be connected to a single database, see #database" ^ (self query: 'SELECT datname FROM pg_database ORDER BY 1') firstColumnData ] @@ -442,17 +443,16 @@ P3Client >> listEnums [ P3Client >> listSchemas [ "Return the list of known schema or namespace names" - ^ (self query: 'SELECT nspname FROM pg_namespace ORDER BY 1') firstColumnData + ^ (self query: 'SELECT schema_name FROM information_schema.schemata ORDER BY 1') firstColumnData ] { #category : #convenience } P3Client >> listTablesInSchema: schemaName [ - "Return the list of known table names in a given schema" + "Return the list of known table names in a given schema as table name, table type pairs." - | query | - query := 'SELECT tablename FROM pg_tables WHERE schemaname=''{1}'' ORDER BY 1' - format: { schemaName }. - ^ (self query: query) firstColumnData + | statement | + statement := self format: 'SELECT table_name, table_type FROM information_schema.tables WHERE table_schema = $1 ORDER BY 1'. + ^ (statement query: { schemaName } ) data ] { #category : #configuration }