Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't handle array type #9

Closed
pidu opened this issue Nov 14, 2018 · 7 comments
Closed

Can't handle array type #9

pidu opened this issue Nov 14, 2018 · 7 comments

Comments

@pidu
Copy link

pidu commented Nov 14, 2018

Trying to select a _varchar (array) column I get this Error (cannot convert typeOid 1015):

P3Converter(Object)>>error:
[ self
	error: 'P3 cannot convert typeOid ' , description typeOid asString ] in P3Converter>>convert:length:description:
IdentityDictionary(Dictionary)>>at:ifAbsent:
P3Converter>>convert:length:description:
P3RowFieldDescription>>convert:length:using:
P3Client>>processDataRowUsing:
[ :out | 
[ self readMessage tag = $C ]
	whileFalse: [ self assert: message tag = $D.
		out nextPut: (self processDataRowUsing: result descriptions) ] ] in P3Client>>runQueryResult
Array class(SequenceableCollection class)>>new:streamContents:
Array class(SequenceableCollection class)>>streamContents:
P3Client>>runQueryResult
P3Client>>query:
[ client
	query: 'select id,locale,created_at,confidential,rights from users limit 3' ] in [ :client | 
[ client
	query: 'select id,locale,created_at,confidential,rights from users limit 3' ]
	ensure: [ client close ] ] in UndefinedObject>>DoIt
BlockClosure>>ensure:
[ :client | 
[ client
	query: 'select id,locale,created_at,confidential,rights from users limit 3' ]
	ensure: [ client close ] ] in UndefinedObject>>DoIt
P3Client(Object)>>in:
UndefinedObject>>DoIt
OpalCompiler>>evaluate
RubSmalltalkEditor>>evaluate:andDo:
RubSmalltalkEditor>>highlightEvaluateAndDo:
[ textMorph textArea editor highlightEvaluateAndDo: ann action.
textMorph shoutStyler style: textMorph text ] in [ textMorph textArea
	handleEdit: [ textMorph textArea editor highlightEvaluateAndDo: ann action.
		textMorph shoutStyler style: textMorph text ] ] in GLMMorphicPharoScriptRenderer(GLMMorphicPharoCodeRenderer)>>actOnHighlightAndEvaluate:
RubEditingArea(RubAbstractTextArea)>>handleEdit:
[ textMorph textArea
	handleEdit: [ textMorph textArea editor highlightEvaluateAndDo: ann action.
		textMorph shoutStyler style: textMorph text ] ] in GLMMorphicPharoScriptRenderer(GLMMorphicPharoCodeRenderer)>>actOnHighlightAndEvaluate:
WorldState>>runStepMethodsIn:
WorldMorph>>runStepMethods
WorldState>>doOneCycleNowFor:
WorldState>>doOneCycleFor:
WorldMorph>>doOneCycle
WorldMorph class>>doOneCycle
[ [ WorldMorph doOneCycle.
Processor yield.
false ] whileFalse: [  ] ] in MorphicUIManager>>spawnNewProcess
[ self value.
Processor terminateActive ] in BlockClosure>>newProcess
@svenvc
Copy link
Owner

svenvc commented Nov 14, 2018

Hi,

There are many (often obscure, specialised, little used) primitive types in PostgreSQL. P3 does current not support them all, just the most common ones.

There is no support for ARRAY types, yet. [ https://www.postgresql.org/docs/9.4/arrays.html ] This basically requires the implementation of a 'array-value parser'. [ https://www.postgresql.org/docs/9.4/arrays.html#ARRAYS-IO ]

This could be put on the todo list, but it won't happen immediately.

Sven

@pidu
Copy link
Author

pidu commented Nov 14, 2018

I was just the first thing I ran into when trying out p3. After creating the issue I went back and re-read the README and saw that you didn't specify full postgresql type support. I should propably have done by due diligence first before reporting this.

@svenvc
Copy link
Owner

svenvc commented Nov 14, 2018

Well, it is of course not much fun, and not a great first experience, if that happens on your first query.

I'll see what I can do, but can't promise anything.

@pidu
Copy link
Author

pidu commented Nov 14, 2018

No need for promises :-) I'm currently just evaluating som smalltalk library options, and ran across this library as I believe it was a rather recent option.

@svenvc
Copy link
Owner

svenvc commented Dec 30, 2018

c09e9d4 adds support for some common array types

can you test ?

@svenvc svenvc closed this as completed Dec 30, 2018
@pidu
Copy link
Author

pidu commented Jan 7, 2019

It works great!

@svenvc
Copy link
Owner

svenvc commented Jan 7, 2019

Thanks for testing, Peter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants