DBKit now supports using any column type for the primary key column (not just numbers as had been the case).
Resolved Issues
Fixed a bug when using DBKit with PostgreSQL that caused the PrimaryKeyColumn function to fail if the table name included the name of the schema.
DBKit.DatePicker (web) now stores null in the database column when there is no date selected.
WebDialogs and WebContainers are now supported in addition to WebPages for web projects. Note that any setup you are going to do for a TableConnection on a WebDialog must be done in the Shown event rather than the Opening event.
Fixed a bug that caused a NOE when uploading a picture to a DBKit.ImageViewer.
New Features
DBKit.SearchField - Provides a Search UI that automatically works with your QueryRowsListBox without any additional code. If you leave the Table property blank, it will find the first TableConnection then bind with its QueryRowsListBox. Otherwise, it will look for a TableConnection on the layout whose Table property matches its own. If you provide columns for it to search it will use them. If you donât, it will use the columns of the QueryRowsListBox to which it is bound. String and Number type columns are supported. For String values, a begins with search is performed. For numeric values, the search is for an exact match. You can use >, < or ⊠for a range. For example, >10 finds rows use searched numeric column has a value greater than 10. Entering 10âŠ20 will find rows whose searched numeric column has a value between 10 and 20. The Show All Rows By Default property if true will display all rows when the SearchField is blank.
DBKit.Toolbar - New control that provides a toolbar with options for New, Delete, Edit and Undo buttons. No code needed. The buttons you wish displayed can be indicated via properties in the Inspector. (For web projects, youâll will need to add the new backicon.png file to your icons folder)
DBKit controls now have a Mandatory property that can be set via code or in the Inspector. Mandatory controls must have a value for the record to be able to be saved. For Slider, the value must be greater than the minimum value. For CheckBox, the checkbox must be checked.
DBKit.NumberField - Handles numeric entry. Choose the type (Currency, Number, Percentage and Custom) and it will handle the formatting and entry masking for you. It includes properties to indicate if you want a thousands separator and the number of decimals you wish to show. Itâs also locale-aware. Choose Custom if you plan to assign a format to the Format property. It also has MinimumValue and MaximumValue properties. It will only allow entry of values between these two numbers provided that they are not the same number. In other words, if MinimumValue and MaximumValue are both 0 then no range checking will be done.
All controls that display database data now have a DisplayName property. If this property has a value, it will be used in any messages (except those displayed as a result of database errors) to the user such as when they have not filled in a mandatory field. If it does not have a value, the name of the control will be used.
New property in âSessionâ db of type DBKit.TableConnection
Following lines added to opening event of session:
dbAdmin = New DBKit.TableConnection
if dbAdmin.Connected(DBKit.TableConnection.DatabaseServer.Postgres, â192.168.1.54â, 5432, âmydatabaseâ, âmyuserâ, âmypasswordâ) then
MessageBox(âconnectedâ)
End
Yes for a web project it would go on Session. In fact, the web example of DBKit and the web tutorial for DBKit show this. As for PG, If you look at the example projects, there are buttons on the main desktop window and webpage that show connecting to MySQL and PostgreSQL.
Regardless, Iâm glad you worked it out! There will be more updates coming. I have endless ideas both to make DBKit easier to use and more powerful at the same time.
Does this also fix the problem when I have pressed the âNewâ button but I donât enter anything and select something else in the listbox? I get the message âYou have unsaved changesâ, when I click Continue it crashes with âcannot rollback - no transaction is activeâ.
Do I always have to press Undo first, even if nothing has been entered?
It is. The only one that is problematic is the Edit button because DBKit toggles it between Edit and Done. Iâm working on a fairly major update (which will be AFTER the next update) that moves all the localization outside of the internal implementation of DBKit so that you can localize the UI without having to alter DBKit at all.
PostgreSQL allows positional placement and parameter reuse. Thatâs a good design. So some people could say the other way around <<too bad others use just â?â>>.
Connection.ExecuteSQL("UPDATE my_table SET special_val = $2 WHERE items = $1 AND special_val <> $2 ;" , groupID, specialValue)
Any idea why is that and why it crashes in the first place ? Should i do something else in particular before running that ?
So far it seems that it is crashing due to Nil for target, and it seems that you designed this to run in Session Only, but in my case i do need the DB to be connected in the App side for some Thread tasks that are to be done unattended and separate from sessions .
Is there a quick fix for this ? or you can push another update for this in the examples to adapt the case ?
I guess same case could apply in the case where you want to use this as an API server without any interface, but in this case the kit could be little bit overkill but still.