public void CreateSchema(IDocumentSchema schema, DocumentMapping mapping)
        {
            var writer= new StringWriter();
            mapping.WriteSchemaObjects(schema, writer);

            _runner.Execute(writer.ToString());
        }
Exemple #2
0
        public void CreateSchema(IDocumentSchema schema, DocumentMapping mapping)
        {
            var writer = new StringWriter();

            mapping.WriteSchemaObjects(schema, writer);

            _runner.Execute(writer.ToString());
        }
        public void write_upsert_sql()
        {
            var mapping = new DocumentMapping(typeof (MySpecialDocument));
            var builder = new StringWriter();

            mapping.WriteSchemaObjects(null, builder);

            var sql = builder.ToString();

            sql.ShouldContain("INSERT INTO mt_doc_myspecialdocument");
            sql.ShouldContain("CREATE OR REPLACE FUNCTION mt_upsert_myspecialdocument");
        }
        public void generate_simple_document_table()
        {
            var mapping = new DocumentMapping(typeof (MySpecialDocument));
            var builder = new StringWriter();

            mapping.WriteSchemaObjects(null, builder);

            var sql = builder.ToString();

            sql.ShouldContain("CREATE TABLE mt_doc_myspecialdocument");
            sql.ShouldContain("jsonb NOT NULL");
        }
Exemple #5
0
 public void WriteSchemaObjects(IDocumentSchema schema, StringWriter writer)
 {
     _parent.WriteSchemaObjects(schema, writer);
 }