title: Creating a database with linq2db
body: <p>I am writing a small program to test out linq2db. What I want to do is create the database if it does not already exist. Most(all?) of the linq2db documentation assumes an existing database.  I check if the database exists and if not create an empty database using CreateCommand as below.  The Intellisense for this says this method is "For internal use only". Is it OK to use CreateCommand or is there a better way?</p>
  
  <pre><code>namespace SqliteTest
  {
      public partial class ImageDatabaseDB : LinqToDB.Data.DataConnection
      {
          public ITable&lt;testTable&gt; testTables { get { return this.GetTable&lt;testTable&gt;(); } }
  
          public void InitMappingSchema()
          {
          }
          public ImageDatabaseDB()
          {
              InitDataContext();
              InitMappingSchema();
          }
          public ImageDatabaseDB(string configuration) : base(configuration)
          {
              InitDataContext();
              InitMappingSchema();
          } 
          partial void InitDataContext();
      }
      [Table("testTable")]
      public partial class testTable
      {
          [PrimaryKey, Identity] public int id;
          [Column, NotNull] public string Name;
          [Column, Nullable] public string Description;
      }
      public static partial class TableExtensions
      {
          public static testTable Find(this ITable&lt;testTable&gt; table, long id)
          {
              return table.FirstOrDefault(t =&gt;
                  t.id == id);
          }
      }
  class Program
  {
      static void Main(string[] args)
      {
          const string dbLocation = @".\TestDatabase\TestDatabase.sqlite";
          if (!File.Exists(dbLocation))
          {
              using (var db = new TestDatabaseDB())
              {
                  db.CreateCommand(); 
                  // create tables...
              }
          }
  
      }
  </code></pre>