How to retrieve all datomic created uris / database names? - datomic

Where does datomic store the uri's / database names ?
I.e. where is Peer.connect() looking ?
In the meantime I'm trying to debug the "web console" to see how the database drop down is populated.

Datomic doesn't store the URI's anywhere, it stores the database names within the storage. The URI is an address that describes both a storage location and a database within it. You can find the databases available within a storage location by using getDatabaseNames from Java or get-database-names in Clojure. connect is attempting to connect to a storage location at the URI and a transactor connected to the same database.

Related

How to verify the data stored in azure

We're in the designing phase. We are extracting the date using API calls and storing the extracted data in Azure SQL Server and i wanted to test whether the exact data is loading in azure or not.
To verify that the data has uploaded into Azure, take the following steps:
Go to the storage account associated with your disk order.
Go to Blob service > Browse blobs. The list of containers is presented. Corresponding to the sub folder that you created under Block Blob and Page Blob`enter code here` folders, containers with the same name are created in your storage account. If the folder names do not conform to Azure naming conventions, then the data upload to Azure will fail.
To verify that the entire data set has loaded, use Microsoft Azure Storage Explorer. Attach the storage account corresponding to the Data Box Disk order and then look at the list of blob containers. Select a container, click …More and then click Folder statistics. In the Activities pane, the statistics for that folder including the number of blobs and the total blob size is displayed. The total blob size in bytes should match the size of the data set.

Multiple database schema for different database in spring boot

I have spring boot application that need to be deployed on PCF. I want to use H2 database for local testing but after deployed in PCF I will be using SQL server. I have a schema that need to be used for each database. So, I have two schema.sql file one for H2 and another for SQL server. How can I tell spring for local profile schema-H2.sql need to be used and for profile cloud schema-sqlserver.sql need to be used.
You can set the spring.datasource.platform to differentiate the schema and data sql file.
eg,
spring.datasource.platform=h2
then the file name should be data-h2.sql and schema-h2.sql
Make sure you set spring.datasource.initialization-mode=always

How to share access 2016 database with multiple user

I migrated my access 97 databases to access 2016 & want to share the database with multiple users having READ/WRITE simultaneously. I kept MS Access 2016 in shared mode and my database in NTFS shared folder in my network.
Even Access is in shared mode when one user is trying to save their changes i am getting this error
Microsoft Acess can't save design changes or to save to a new database object because another user has the file open. To save your design changes or to save to a new object, You must have exclusive access to the file
Suggest me how can i share the database
Thank you :)
Development/Design cannot be shared on the same file. There are steps that need to be done to accomplish this if you have more then 1 developer.
If you are having multiple users update data in the database, split your database using the Database tools > Access Database (Under Move Data tab). This will ask you where you want to save the backend of your file. Choose the file path where you want to save the file.
Take the front end and either email to all your users, or place in a folder location on the share drive for everyone to copy the front end to their desktops.

What is the default location where mac stores sqlite3 databases

I want to pull data from a remote db into an sqlite database I just don't know where the path is to where mac stores sqlite3 files. It's just the default location.
This is the answer I came up with and will post it as an answer when SO lets me.
I don't know if this is the default but I never changed the sqlite3 settings on my macbook so I would assume that this is in fact the default location but like I said I don't know and it just worked for me.
The default location for me was
sqlite://my-apps-name.db
If you keep your sqlite db the same as your applications name all you need to do is give the application name which is also the db file's name after sqlite:// and that should do it.
SQLite3 is not a server-based DBMS like MySQL, which has a centralized location for all its served database files. It does not typically have a default (or even a central) location for databases. It relies on individual files for its databases, which could potentially be located anywhere within the file system.
If you want to create a database, it's up to you where to put it.
The default location for me was
sqlite://my-apps-name.db
If you keep your sqlite db the same as your applications name all you need to do is give the application name which is also the db file's name after sqlite:// and that should do it.

Where to store database credentials in a web app?

I'm wondering what techniques you use to store the database credentials for your application. I'm specifically concerned with java webapps, but I don't think there's any need to limit the questions to that.
things to consider:
Do you use property files,xml configs, other?
Is it bundled into your application(ie in a jar file) or stored seperately on the file system somewhere?
Is the password encrypted? If so, what encryption scheme do you use?
Since you're leaving the question open to platform, I'll add that database credentials for .NET apps are stored in the web.config file. From version 2.0 and above, there is a specific ConnectionStrings section that allows for easier programmatic access to the connection string.
In addition to having IIS automatically block direct requests to the web.config file by default, you can also use an IIS command to encrypt the ConnectionString section of the web.config file. This encryption is machine specific, adding to its strengths, and the .NET runtime will also decrypt the connection string on the fly when you access it, so there is no need for additional coding in your application to work with it.
With Java, database connection pools should be passed into webapps by the container. This is in the standard declarable in WEB-INF/web.xml as resources. The same applies to mail sessions and other external resources that may vary from installation to installation. Look up JNDI for more information on this)
The nice part with this is that the application doesn't care about how to actually connect to anything outside. It will not see any passwords, because the container itself will use them.
In tomcat this is configured either from context files (e.g.) in conf/Catalina/localhost/ , conf/server.xml or - preferably only for dev environments, from the webapps META-INF/context.xml. Other environments have their own configuration location or application.
The encryption of passwords actually depends on the container. Tomcat stores them in plaintext, but the application itself won't see it. I don't know about the mechanics in other environments.
On the Microsoft stack, things can be very nice.
You create a network user account in Active Directory with almost no permissions. You configure IIS to run your webapp as that user. You grant that user read access to the web folders and files on the disk. You configure SQL Server to grant that user read/write permissions on the tables you want. And in the connection string, you instruct the db client to connect as the user account which the webapp is currently being run as.
There is only one actual user account, although it is visible in multiple places. This user account has extremely limited permissions. There is no storing passwords anywhere, even if encrypted. There is no configuration that has to be done in code for this to work (it's all in setting up the permissions).
Depends on the app server.
I usually use JNDI lookups for the data source, so credentials are stored on the app server that handles the connection pool. No need to put anything other than the JNDI name in configuration that way.
Yes, the password is encrypted on WebLogic.
On Tomcat things can be dicey. Connection info is in META-INF/context.xml, which means plain text for the password. I only do that for development, never in production.
In Django, the credentials are in your settings.py configuration file. Since this is not generally kept in your /var/www/ directory tree, it's very safe.
Also, a single Django application may be used (and reused) for many web sites or web servers on the same host, each with it's own distinct settings. So the settings.py configuration is not bundled with the app, but is part of a single deployment of the app.
For asp.net:
I store global parameters such as the connection string and repository paths in the Registry and then a reference to the registry entry in the web.config.
The main reason being that I often find I have to write a stand alone executable to run background tasks and other automated features that require access to the same parameters. Therefore keeping everything that is truly global in one easily accessible place makes for an easier life.
As stated before, no platform specified, and using some ideas from earlier answers:
I am considering a containerised application. You could store the password for the database in a file in the container. The first step of your application would be to establish the database connection, even before listening on web requests. With a successful db connection the file with the credentials is deleted and the variables containing the these, are removed. So when you start serving requests, the only thing that remains, is an open database handle to use from this moment on. If for any reason the database connection is lost, you simply quit and wait to restart the container, the credentials file will be there again.
Which of these are good places to keep your web app’s database credentials?
In a separate file in your source code
In a separate file on your web server host
In your database
None. The database credentials should never be stored

Resources