Alpha Software Blog



Database Snapshots: Make Data Integration a Snap

Data can be integrated into mobile, web, or desktop applications using Alpha Anywhere. Built on a model that uses a low-code approach, connecting to a database and importing data into an app for viewing or editing is easily accomplished. Reporting, charts and graphs, mapping, and other visual aids can also be created using data from back-end databases in Alpha Anywhere applications.

In addition to data integration, Alpha Anywhere includes features for creating snapshots of databases. With snapshots, you can easily do the following:

  • Assemble a sample database for use in demos or examples.
  • Create a test database that can be rolled back to its original state.
  • Build an initial database that is shipped with the app.

Creating and Storing Snapshots

Creating snapshots in Alpha Anywhere can be accomplished using xbasic. The SQL::DatabaseSnapshot is used to create an in-memory database. Using Alpha Anywhere's AlphaDAO connection strings, data can be loaded from and stored in any database system for which an AlphaDAO connection string can be built. This means data loaded from a data source such as MS Access can be stored in other database system - SQL Server, MySQL, Postgress, etc.

For example, the following script creates a snapshot of a database accessed using the "::Name::SourceDatabase" connection string and stores the snapshot a target database defined by the "::Name::TargetDatabase" connection string.

dim cn as SQL::Connection
dim sn as SQL::DatabaseSnapshot

' Open the source database
cn.open("::Name::SourceDatabase")

' Load the snapshot of the source database
sn.load(cn)

Dim cn2 as SQL::Connection

' Open the target database
cn2.open("::Name::TargetDatabase")

' Save the snapshot in the target database
sn.store(cn2)

cn.close()
cn2.close()

This is a simple example. It is important to note that snapshots are stored as in-memory databases. If your database is larger than Alpha Anywhere can store in memory, you will not be able to load the entire database. For the standard use case of creating initial, sample, and test databases, this limitation should not be an issue for most developers.

Creating Samples: Snapshotting a Table

Sharing components is a common practice among Alpha Anywhere developers. Often, when asking for help on the Alpha Forum, users will ask to see a component that demonstrates the issue. If the component relies on data in SQL database, a sample of the tables used by the component needs to be provided with the component, otherwise the component can't be tested.

Using snapshots, a sample table can be created that can be included with a shared component. We have put together a How To article that discusses how this could be done using snapshots and SQLLocalDB - a trimmed down version of SQL Server that now ships with Alpha Anywhere.

To learn more, visit the how to article here: How to Create a Database Snapshot and Store it in a SQLLocalDB Database

Additional Resources

For more information about Database Snapshots, visit our documentation. We have several guides in addition to the How To article linked above. We also have full API documentation for the SQL::DatabaseSnapshot, SQL::TableSnapshot, and related xbasic classes and functions used for creating and loading snapshots with Alpha Anywhere.

Prev Post Image
Gartner insights into Building mobile Apps - Mobile Optimized Forms
Next Post Image
Report: How Local Government CIOs Can Improve Mobile App Strategies

About Author

Sarah Mitchell
Sarah Mitchell

Technical Writer and Documentation Expert at Alpha Software

Related Posts
Manufacturing Data Collection Systems: Manufacturing Efficiency and Productivity In The Fourth Industrial Revolution
Manufacturing Data Collection Systems: Manufacturing Efficiency and Productivity In The Fourth Industrial Revolution
New Webinar: How to Integrate ChatGPT with Alpha Anywhere
New Webinar: How to Integrate ChatGPT with Alpha Anywhere
Best Data Collection Software For Manufacturing [2024]: A 101 Guide
Best Data Collection Software For Manufacturing [2024]: A 101 Guide

The Alpha platform is the only unified mobile and web app development and deployment environment with distinct “no-code” and “low-code” components. Using the Alpha TransForm no-code product, business users and developers can take full advantage of all the capabilities of the smartphone to turn any form into a mobile app in minutes, and power users can add advanced app functionality with Alpha TransForm's built-in programming language. IT developers can use the Alpha Anywhere low-code environment to develop complex web or mobile business apps from scratch, integrate data with existing systems of record and workflows (including data collected via Alpha TransForm), and add additional security or authentication requirements to protect corporate data.

Comment