Quick Start with ODataDB
Quick Start on Windows
- Download the ODataDB package.
- Unzip it to any folder on a local drive.
- Run odatadb.exe in the odatadb subfolder.
You have to see the following console app:
If you do not see the console, download and install the Hosting Bundle, which includes the .NET Core Runtime and IIS support, at
- https://dotnet.microsoft.com/en-us/download/dotnet/3.1 for ODataDB 3.x
- https://dotnet.microsoft.com/en-us/download/dotnet/6.0 for ODataDB 4.x
When you see the console app, open the URL: http://localhost:5002
You have to see the index page:
You can play with samples. ODataDB loads data from an online SQL Server database.
For example, try the s02_cashbook table:
Then add a connection string into the appsettings.Production.json file using the mssql connection as a template:
"ConnectionStrings": { "mssql": { "ProviderName": "System.Data.SqlClient", "ConnectionString": "Data Source=mssql.savetodb.com;Initial Catalog=AzureDemo100;User ID=user;Pwd=pass" },
You can add a connection string for an SQL Server, Oracle Database, MySQL, MariaDB, PostgreSQL, DB2, or NuoDB database.
For example, you can add a test connection string:
"test": { "ProviderName": "System.Data.SqlClient", "ConnectionString": "Data Source=.\SQLEXPRESS;Initial Catalog=TestDatabase;User ID=user;Pwd=pass" },
Close and open the console odatadb.exe app when you add a new connection.
Try to connect to your database.
For example, if you have created the 'test' connection string, open the link like http://localhost:5002/edit/test/
That's all. You have created a working sample.
Now you can install ODataDB under IIS.
Quick Start on Linux
- Download the ODataDB package.
- Unzip it and copy the odatadb folder to the /var/www folder.
- Go to the /var/www/odatadb folder and run: dotnet odatadb.dll
You have to see the following response:
If ODataDB cannot start, install the ASP.NET Core Runtime using instructions at
- https://dotnet.microsoft.com/en-us/download/dotnet/3.1 for ODataDB 3.x
- https://dotnet.microsoft.com/en-us/download/dotnet/6.0 for ODataDB 4.x
When you start ODataDB, try to get data using a command like this:
curl http://localhost:5002/v4/mssql-023/cashbook
You have to see data from an online SQL Server database.
That's all for now. Press Ctrl-C to close the app. See how to install ODataDB on Linux.