Code Monkey home page Code Monkey logo

Comments (7)

ivanceras avatar ivanceras commented on May 27, 2024

Ah yes, I skimmed through common data types, I added support for ArrayType(Text) since it is in sakila example. I'll add ArrayType(Int) soon. Thanks for testing out.

from diwata.

ivanceras avatar ivanceras commented on May 27, 2024

The specific commit is here ivanceras/rustorm@1324c9a

from diwata.

ivanceras avatar ivanceras commented on May 27, 2024

I just published a new version of [email protected] with support for some ArrayType for int[], float[], text[] variants.
You could try to reinstall the cli with

cargo +nightly install -f diwata_cli

See if it doesn't panic anymore. If it does, then most likely your database is using data types that has not supported yet.

from diwata.

sebmiq avatar sebmiq commented on May 27, 2024

Thanks for the quick reply.

Unfortunately, I still get a panic: unable to parse integer value: Err(ParseIntError { kind: Empty }), Error:ParseIntError { kind: Empty }', rustorm-0.10.6/src/pg/column_info.rs:216:47

Here's my table:

       Column         |       Type        |                     Modifiers                     | Storage  | Stats target | Description 
-----------------------+-------------------+---------------------------------------------------+----------+--------------+-------------
 id                    | integer           | not null default nextval('exos_id_seq'::regclass) | plain    |              | 
 origin                | character varying |                                                   | extended |              | 
 difficulty            | integer           |                                                   | plain    |              | 
 topic                 | character varying | not null                                          | extended |              | 
 subtopic              | character varying | not null                                          | extended |              | 
 comment               | character varying |                                                   | extended |              | 
 toknow                | boolean           |                                                   | plain    |              | 
 interesting           | boolean           |                                                   | plain    |              | 
 lesser                | integer[]         | default '{}'::integer[]                           | extended |              | 
 related               | integer[]         | default '{}'::integer[]                           | extended |              | 
 topics                | text[]            |                                                   | extended |              | 
 subtopics             | text[]            |                                                   | extended |              | 
 subsubtopic           | text              |                                                   | extended |              | 
 textsearchable_vector | tsvector          |                                                   | extended |              | 
 pm                    | smallint          | default 0                                         | plain    |              | 
 favorite              | boolean           | default false                                     | plain    |              | 
Indexes:
    "exos_pkey" PRIMARY KEY, btree (id)
    "textsearch_idx" gin (textsearchable_vector)

I'm not sure if the panic is an issue with array support, or with the tsvector type. If it's the latter, it may be more reasonable to just ignore columns with unsupported types ?

from diwata.

ivanceras avatar ivanceras commented on May 27, 2024

It looks like the default integer value {} is empty array which I haven't take into consideration, this should be an easy fix.
I already had support for tsvector, so it wouldn't be a problem. As an early version, I prefer the app to panic in the mean time, since this is the fastest way to fix things right away. I'll have to return proper error when most of the types are already covered.

from diwata.

ivanceras avatar ivanceras commented on May 27, 2024

This commit ivanceras/rustorm@bdfcdeb should fix the panic for empty array defaults. Please try to reinstall the diwata_cli to see if it works now. I'm betting this would work if you don't have anymore uncommon database types used in your design.

from diwata.

sebmiq avatar sebmiq commented on May 27, 2024

Looking good, thanks !

from diwata.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.