Forum Replies Created
-
AuthorPosts
-
May 28, 2017 at 9:25 am in reply to: Newbie question #3 — possible enhancements for external tools? #1306
amckinlay
KeymasterI can see how that would be useful, but it’s not something we have a need for, so unfortunately, we’re unlikely to do it.
amckinlay
KeymasterSuneido doesn’t have auto incremented numeric keys.
We use Timestamp() to get automatic unique keys. Our usual approach is to use a rule to set the timestamp.
Timestamps have the side benefit of giving you the creation date/time of each record.
You can also have an _TS field that is automatically set to the last modified date/time.
amckinlay
KeymasterNo, there isn’t an option for that, although it probably wouldn’t be hard to add.
One option is to just use different (sub) directories for each copy.
The way we usually work is to use a single database and to switch between applications by using/unusing the appropriate libraries. To deploy a single application you can strip down a database to just what’s required.
amckinlay
KeymasterThanks Dave, hope it fits your needs.
amckinlay
KeymasterThanks Jason. Sorry for the slow reply – my email notifications seem to not be working.
Unfortunately, that’s not what the comment meant.
Database ensure internally does a check if the table schema already matches.
What we really want to avoid is doing an extra client-server database request every time, even though 99.99% of the time it’s unnecessary. (Although in the big picture this probably isn’t that big a deal.)
The question then becomes, who is responsible for creating the table? Maybe you just make ensureQueue public and leave it up to the application code to create it at some point.
amckinlay
KeymasterGlad you got your work back ๐
I have thought about allowing rebuild as of a given date/time. It probably would not be that hard.
I am reluctant because I think it would encourage people to depend on it, which I do not think is a good idea. Rebuild was intended for crash recovery, not for normal usage. It could be useful though.
amckinlay
KeymasterSorry, I forgot about that check. The file size must be a multiple of 8. If you delete or insert make sure it’s a multiple of 8 characters. Probably simpler just to overwrite some characters. (Pressing the INS key should switch you to overwrite mode.)
amckinlay
KeymasterNo backups ๐
There should be a suneido.bak if you have compacted or loaded the database.
Before you try anything else, make a copy of the database and put it somewhere safe.
As long as you haven’t compacted (or dump/load), the old data is still in the database file, but there is no easy way to get it.
The history doesn’t work if a table has been destroyed and recreated (as load does).
If you just need a few records you can open a copy of the database with a text editor that can handle large files. (e.g. Scite) Then search for either the name of the record or something in it. If the record has been updated there will be multiple versions in the file. The last one will be the most recent. Then just copy the text. (There will be a lot of unreadable binary data in the file as well, but the text itself should be readable.)
Another possibility is to force Suneido to rebuild the database as of just before you loaded the file. To do this you either need to truncate or corrupt the file at the right point. Again, you want to do this on a copy of the database that you don’t mind losing. The trick is to know what the right point is. If you look at the database in an editor you may be able to see where the load of the new library started. Past that, it may be a matter of trial and error. Corrupting is easy, just overwrite/delete/insert random characters. This will make the checksums fail.
NOTE: If you are using a text editor to truncate/corrupt the database file, make sure the editor isn’t altering anything else, e.g. not changing line endings or altering the binary data. Scite is usually ok.
Once you’ve corrupted/truncated the database file, run suneido -rebuild. It should tell you what date/time it is restoring to. If it doesn’t go back far enough, then truncate/corrupt earlier in the file. If it goes back too far, then take a fresh copy and truncate/corrupt later in the file.
I can’t guarantee this last method will be successful.
Sorry there isn’t an easier answer.
amckinlay
KeymasterYou can either move your tables to a new database, or move the new tables to an old database (probably easier).
This is done by using suneido -dump
(from the command line) in the source database directory, moving the .su to the destination directory, and then suneido -load in the destination database directory. The main tables you need from the new database are stdlib, suneidoc (the help), and imagebook. You may also want the Contrib library.
If you move the new tables to an old database, I would recommend dumping and loading the entire database to ensure it has been created with the new exe.
Of course, you also need to use the new exe and dll’s.
I would recommend making a backup before you do any of this in case you run into any problems.
amckinlay
KeymasterTheoretically, up to 32gb. This is a result of using 32 bit “addresses” (4 gb) with 8 byte alignment.
In practice, I would not use cSuneido (the Windows exe) for more than 1 or 2 gb because it is a 32 bit program and therefore can only memory map that much address space. It will map segments to get around this but it will be slower.
For larger databases I would recommend running client-server using jSuneido (the Java version) as the database server. Running on a 64 bit JRE this allows a much bigger address space.
jSuneido also has a new database engine which is faster and more crash proof.
amckinlay
KeymasterIf you are calling SetQuery in your Load_list method, you need to pass the columns (since they could be different for the new query) otherwise they will default to all.
amckinlay
KeymasterYou need to Set that control to something like:
Object(operation: 'equals', value: Date(), value2: "")
If you are going to be running a report, you probably want to use Params which has a Set_Params member which can be used to do this.
amckinlay
KeymasterI know there have been issues with GroupBox. I would suggest trying it without that.
We do not use GroupBox much but we tried your code on our latest internal version and it seems to work so we may have fixed the problem since the last release.
amckinlay
KeymasterI think it is working correctly.
Is there a reason you are using Display? It will add quotes to strings, and then when the result is displayed it will also add a set of quotes.
Based on your expected result I think you just want: ob[0] $ ob[1]
amckinlay
KeymasterHi Tahar,
The answer is yes and no ๐
There are lots of changes in the code on Github. But to get these changes you would need to build from source, which is not hard, but still requires some work. And you would still need a current copy of stdlib which is not on Github.
I have not made a pre-built release since 2013. That is just my laziness. I am busy, but it does not take much time. I should put out releases more often.
-
AuthorPosts