Uploading table definitions

Building

phd     5 months ago

Hello,

Not found in the wiki, could someone give an example of a csv file for creating a table (creating, not just populating) from upload csv ?

Great thanks !



tomn      5 months ago

So as you point you have two options:

Either create the table 1st with all the columns, and then upload a CSV. If you want to see what the format should be like, then you can try downloading a CSV with the empty table or even better when you have created a single row and then try to match that in your spreadsheet. I've tried to make it quite liberal in the importer so it should accept a variety of values But it is of course difficult to make it accept everything. If you find a particular example that doesn't work, please send it to me and I can make it work.

Alternatively, you can create a table on upload. Again I've tried to make it accept As many different formats as possible, but this work is probably incomplete. The format should be the same as in the above case.

Sounds like we need a wiki page for this


No row selected
No row selected
      5 months ago

1 - Tried this :

id, key
t-lib, string
t-num, number
t-created, date

got : Columns named "id" must have only integers

2 - tried this :

id, t-lib, t-num, t-created

creates table, but only one field id

3 - tried this :

id, 1
t-lib, libel

got : Columns named "id" must have only integers

4 - Try this :

id, t-lib
1, libel

got : Required field missing: T-lib


tomn      4 months ago

maybe try without minus sign in field names (I can try to improve handling of this in the future) ?


No row selected
No row selected
      4 months ago

Thanks Tomn, this gives far better results. Here is what I did, when everything OK it could become the beginning of a wiki entry :

Note : Give a line for field names, a second line for sample data which will determine field types.

Note : Dont use - or _ in field names

Example:

id, tlib, tnum, tcreated, tfile, tkey
1, text, 1, '2020/01/01 12:30', /file.txt, test.id

Creates :

(sorry, I'm french and some translations appear here)

Question 1: Not found how to get other field types

Date ?
2021/01/01  -> field type string
20210101    -> field type number
16204846465 -> field type number

File ?
/file.txt   -> field type string

Key to other table ?
tablename.id -> field type string

Perhaps a second line would be useful, something like this (not working at the moment) :

id, tlib, tnum, tcreated, tfile, tkey
key, string, number, date, file, foreignkey othertable

...data lines

Question 2: mandatory attribute can be unticked in screen Edit field/basic properties, but this doesnt work

I'm sorry being always asking, at least answers will remain in forum, hope it will be useful for others later  ...

 


phd      4 months ago

(sorry for typo, and included image doesnt appears)

Example:

id, tlib, tnum, tcreated, tfile, tkey
1, text, 1, '2020/01/01 12:30', /file.txt, test.id

Creates fields :

ID integer, primary key, mandatory, unique

Tlib string mandatory

Tnum integer mandatory

Tcreated string mandatory

Tfile string mandatory

Tkey string mandatory

 


phd      4 months ago

(Sorry, typo cant be changed) Here is a new post, cancels and replaces previous ones for better understanding 

Thanks Tomn, this gives far better results. Here is what I did, when everything OK it could become the beginning of a wiki entry :

Note : Give a line for field names, a second line for sample data which will determine field types.

Note : Dont use - or _ in field names

Example:

id, tlib, tnum, tcreated, tfile, tkey
1, text, 1, '2020/01/01 12:30', /file.txt, test.id

Creates :

ID integer, primary key, mandatory, unique

Tlib string mandatory

Tnum integer mandatory

Tcreated string mandatory

Tfile string mandatory

Tkey string mandatory

Question 1: Not found how to get other field types

Date ?
2021/01/01  -> field type string
20210101    -> field type number
16204846465 -> field type number

File ?
/file.txt   -> field type string

Key to other table ?
tablename.id -> field type string

Perhaps a second line would be useful, something like this (not working at the moment) :

id, tlib, tnum, tcreated, tfile, tkey
key, string, number, date, file, foreignkey othertable

...data lines

Question 2: mandatory attribute can be unticked in screen Edit field/basic properties, but this doesnt work

I'm sorry being always asking, at least answers will remain in forum, hope it will be useful for others later  ...



Sign up to post a reply