SchemaSpy : A free tool to generate data model (ER Diagram) for salesforce


Inbuilt schema builder of does provide the capability to generate the data-model of objects. But you can’t export it in any format, and it is very difficult to visualize it when the list of objects are growing (more than 30 objects).

There are various tools out their to create ER Diagram, but either they requires good amount of investment to purchase the license of those software, or the free tools are limited in capabilities and requires lot of manual task. Which becomes pain when the objects are more than 100.


It is a java based command line tool that can be executed in windows or mac machine (have not tested on Linux). It gets connected to through your username and password+security token, and analyzes the objects and their relationship, to generate a visual ER Diagram with the help of Graphviz. To get more detailed information please visit the project page.


Prerequisites :
Prior to starting installation of schemaSpy following should already be installed and configured on your system -

  1. Apache Ant —
  2. Salesforce Ant Migration Tool —
  3. GraphViz —

Folder structure :
I created a folder named as — “schema” inside my-documents.
inside which following should be the structure —

Required files:
Download the following files from here —

  1. force-metadata-jdbc-driver-1.4.jar
  2. generated-sforce-partner-18.jar
  4. — extract all files from it.
  5. Also download latest version of schemaSpy_*.*.*.jar from here —

Keep all files on to “schemaspy” folder as shown above in the diagram.

Configurations :

In the parent directory there is a file —


which will need to be updated as per the requirement. I did connected to sandbox org instead of production org. So following configuration is set accordingly -


Running the application :
Open your preferred command line application. I did used command prompt in windows 10. Navigate to the directory — ‘schema’ where build.xml is stored, using command line, and execute the following command -


It will then generate list of HTML files inside ‘doc’ folder.

Just open the …


file from inside the doc folder, and you are good to go.

Browse to tab ‘Relationship’ from the browser, and all ER Diagram will be presented here.

Errors :

While running the Schemaspy I came across 2 errors —

  1. Illegal group reference —

When I analyzed it, found that there is $ (Dollar) symbol being used in my password. So to ignore that, we can add a backslash (\) just before the dollar symbol ($). It will not affect the password.

2. Failed to connect to database —

The default URL to be used to connect to salesforce is of Production, i.e. ‘’, but I was trying to connect to sandbox Org (as my credentials were of sandbox). So to change the URL, modify the ‘build.xml’ , and add following line —

<property name="sf.url" value=""

under the <project> tag. And following line —

<arg line="-connprops url\=${sf.url};">

under the <java classname> tag

References :





Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Automate DevOps with hyper — One API, many Services…

.NET Upgrade Assistant — Asp.Net Migrations from .Net 2.1/2.2/3.1/4.6/4.8 to Asp.Net 6

A Typographic Trick for Software Engineering Leaders to Prompt Better Ideas: The Leading Bullet

A Gentle Introduction to Computer Vision, Part 1: Compiling OpenCV on the Jetson Xavier NX

How sorted array process faster than Unsorted array? (in short Branch Prediction)

•twins• . . Done at @polifamous_tattoo_atelier Using @water_law_tattoo butter an…

How to Add the Syncfusion Blazor Chips Component to a Blazor WebAssembly App

Flutter: A Portable UI Framework For Mobile, Web, Embedded, And Desktop

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Pankaj singh

Pankaj singh

More from Medium

No Code Salesforce Integration with Cognism

Salesforce to Salesforce Integration using REST Webservice

Saving $$ with Salesforce

Interview Questions on Future Method in Salesforce