iOS Question [B4X] DBUtils2 - CreateTable not standardized

Alexander Stolte

Expert
Licensed User
Longtime User
Hey,
on B4A we need a map of the fields and types and on B4I we need 2 lists?
B4X:
DBUtils.CreateTable(main_sql,"mytable",CreateMap("id":DBUtils.DB_INTEGER),"id")
That makes double work.
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
You should use DBUtils2: https://www.b4x.com/android/forum/threads/b4x-dbutils-2.81280/
This is the newer version and it is cross platform.

1. It uses two lists.
2. It doesn't make double work. The difference between writing the map based code to two lists based code will not take you more than 30 seconds.
3. The secret reason behind it is: maps in B4i do not preserve the order so we cannot use a map here (tip: use B4XOrderedMap if you need to preserve order)
 
Upvote 0

Alexander Stolte

Expert
Licensed User
Longtime User
B4A:
1594979133663.png

B4I:
1594979166733.png
 
Upvote 0

TILogistic

Expert
Licensed User
Longtime User
You should use DBUtils2: https://www.b4x.com/android/forum/threads/b4x-dbutils-2.81280/
This is the newer version and it is cross platform.

1. It uses two lists.
2. It doesn't make double work. The difference between writing the map based code to two lists based code will not take you more than 30 seconds.
3. The secret reason behind it is: maps in B4i do not preserve the order so we cannot use a map here (tip: use B4XOrderedMap if you need to preserve order)

3. The secret reason behind it is: maps in B4i do not preserve the order so we cannot use a map here (tip: use B4XOrderedMap if you need to preserve order)

😇😇😇😇😇😇
 
Upvote 0
Top