4D Blog

Home Product Improving databases tests

Improving databases tests

November 14, 2018

Product

As a developer, you’re aware that improving the quality of your developments is often based on unit tests. In order to launch these tests, developers and QA teams need tools to launch 4D databases in different modes (single user / client-server) and distinct environments (Macintosh / Windows).

4D products can already be launched using command line parameters to allow automatic testing or deployment. What if you want to create your own update mechanism or you need to handle a server farm with hundreds of 4D Servers running? Maybe you want to specify which database file to use – or pass parameters on launch …

Reminder

The command line can be used the same way on both macOS and Windows. 

The simplified syntax looks like this:  App + structure + data

4D Application --structure <path to structure file> --data <path to data file>

New in 4D V17 R3

With 4D v17 R3, new parameters have been added to give you more flexibility when opening your databases:

  • –opening-mode: will specify to open your database in interpreted or compiled mode
  • –create-data: will create new data if the current data file is not found or with a specific name if – –data is passed!
  • –user-param: will send a string that can be read after the database is launched using the GET DATABASE PARAMETER command (detailed below)

 

GET / SET DATABASE PARAMETER 

It’s now possible to set a database parameter of text type that can be retrieved once the database has been relaunched with the RESTART 4D, OPEN DATA FILE, or OPEN DATABASE command. This will avoid writing and reading temporary files on disk, as well as make your work easier and efficient.

SET DATABASE PARAMETER(User param value;$userParam)

After restarting the database, the $userParam can be read the same way:

$result:=Get database parameter(User param value;$userParam)

4DLINK

Note that the user param can also be set inside the 4DLINK file!
If you want to know more about 4DLINKS, see the documentation here.

<database_shortcut structure_opening_mode="1"
structure_file="file:///Users/Mike/Orda.4dbase.4DB"
data_file="file:///Users/Mike/Orda.4dbase.4DD"
user_param="check"/>

 

HDI: Relaunch and Test 

For more details, check out the documentation.

Happy testing!

Discuss

Tags CI/CD, CLI, Database, Programming, v17 R3, v18

Latest related posts

  • December 3, 2025

    Give AI to a 30 years old 4D application

  • November 28, 2025

    ORDA – Handle an event-driven logic during database operations

  • November 27, 2025

    ORDA – Permissions – Restrict / allow web access to the resources in one click

Roland Lannuzel
Roland Lannuzel
• Product Owner & 4D Expert • After studying electronics, Roland went into industrial IT as a developer and consultant, building solutions for customers with a variety of databases and technologies. In the late 80’s he fell in love with 4D and has used it in writing business applications that include accounting, billing and email systems.Eventually joining the company in 1997, Roland’s valuable contributions include designing specifications, testing tools, demos as well as training and speaking to the 4D community at many conferences. He continues to actively shape the future of 4D by defining new features and database development tools.
  • Deutsch
  • Français
  • English
  • Português
  • Čeština
  • Español
  • Italiano
  • 日本語

Categories

Browse categories

  • AI
  • 4D View Pro
  • 4D Write Pro
  • 4D for Mobile
  • Email
  • Development Mode
  • 4D Language
  • ORDA
  • User Interface / GUI
  • Qodly Studio
  • Server
  • Maintenance
  • Deployment
  • 4D Tutorials
  • Generic
  • 4D Summit sessions and other online videos

Tags

4D AIKit 4D for Android 4D for iOS 4D NetKit 4D Qodly Pro 4D View Pro 4D Write Pro 20 R10 21 Administration AI Artificial Intelligence Build application Class Client/Server Code editor Collections Compatibility settings Formula Google Listbox Logs Mail Network Objects OpenAI ORDA PDF Pictures Preemptive Programming REST Scalability Security Session Source control Speed Spreadsheet Tutorial UI User Experience v20 vscode Web Word processor

Tags

4D AIKit 4D for Android 4D for iOS 4D NetKit 4D Qodly Pro 4D View Pro 4D Write Pro 20 R10 21 Administration AI Artificial Intelligence Build application Class Client/Server Code editor Collections Compatibility settings Formula Google Listbox Logs Mail Network Objects OpenAI ORDA PDF Pictures Preemptive Programming REST Scalability Security Session Source control Speed Spreadsheet Tutorial UI User Experience v20 vscode Web Word processor
Subscribe to 4D Newsletter

© 2025 4D SAS - All rights reserved
Terms & Conditions | Legal Notices | Data Policy | Cookie Policy | Contact us | Write for us


Subscribe to 4D Newsletter

* Your privacy is very important to us. Please click here to view our Policy

Contact us

Got a question, suggestion or just want to get in touch with the 4D bloggers? Drop us a line!

* Your privacy is very important to us. Please click here to view our Policy