Shawn

Shawn Wildermuth

Stories

Tagged with MSchema


M Language Changes Coming in Next CTP

Oslo

If you haven't been following the new Specification for the M Language that the Oslo team has been cooking up, they have been making changes in response to feedback about the language.  These changes will come to light in the next CTP.  These changes are;

'=>' as label binding operator

Read...


How Relationships are Modeled in "MSchema"

Url: http://wilderminds.blob.core.windows.net/downloads/MappingRelation...

Oslo

I've been playing a lot with M to do my database and test data loads for some internal projects for AgiliTrain and I've noticed an interesting representation for how relationships in MSchema are generating their SQL. In MSchema you have a couple of ways to represent a relationship between tables. The relationship syntax is one feature I really like in MSchema.  For example, let's take the Northwind database's Customers and Orders tables. In MSchema I can define them in a traditional way where the Order has a reference to the Customer table:

Read...


Building AgiliTrain: Part 1 - Why ASP.NET MVC

Url: https://AgiliTrain.com

I've spent the better part of six weeks building the new AgiliTrain website and its been quite a lot of fun. Of course if you have been reading this blog for long you know that I usually take a personal project like this as an opportunity to learning something new.  In this case I did three things I haven't done on a personal project before:

I've been itching to use ASP.NET MVC on a project but until the beta arrived I didn't want spend too much time with it.  Of course as you probably know, ASP.NET MVC released a RC yesterday so its pretty close to being done.  I am still on the Beta until they RTW (release to web) ASP.NET MVC.  Don't want to retrofit it twice.

Read...


MSchema: An Example - Part 3

Url: http://wilderminds.blob.core.windows.net/downloads/StudentSchema.zip

In Part 1 of this series I showed you how to create database schema with MSchema. Then in Part 2 I showed you how to use MGraph to create data to store the in the database along side database schema. In this last part, I will show you how to use the M tools to put the schema and data in the database.  I use these tools to build my database during a build script.

The first thing we need to do is to compile the schema. You can do this with the m.exe tool that ships with the Oslo SDK. While many of the demo's I've seen have pushed the data into the Repository, I want to push it into a generalized database. (My site isn't ready to be build on top of Oslo since its going to be released quite soon so I am just using the MSchema stack to help me build the database). When we compile the schema we can tell the tool type of target we're going to aim for.  In our case we will target TSQL instead of the repository.  So the first call in my database build script is to build the schema like so:

Read...


MSchema: An Example - Part 2

Url: http://wilderminds.blob.core.windows.net/downloads/StudentSchema.zip

If you have read Part 1 of this series, you have seen how to create types, collections and constraints using MSchema. Along with most database schemas, I find the need to create some amount of data to go along with those schemas. For my current project (our new web site), I wanted to have some small set of data that included some basic workshops and locations.

To create the data we can use the MGraph language. MGraph is related to MSchema but is a way of describing concrete instances of data. To create an instance:

Read...


MSchema: An Example - Part 1

Url: http://wilderminds.blob.core.windows.net/downloads/StudentSchema.zip

As most of you know, I run a small training company. We are in the midst of a re-write of our main website to allow for more cohesive registration and information about our classes. For this project, I am completely re-creating my database schema (as the old one was a bit 'off the cuff'). What a great opportunity to try out MSchema to build the new schema.

I am going to show you some features in three parts.  In this first part I will show you how to define some interesting data types in MSchema. In the second part I will show you how to define your static or test data in MGraph that can be inserted into the database along with your schema. Then finally in the third part I will show you how to use the command-line tools to build your schema from the M files.  Onto the first part!

Read...


MSchema and Decorator Tables

Url: http://social.msdn.microsoft.com/Forums/en-US/o...

When I first grabbed the Oslo SDK, I wanted to first dive into MSchema.  MSchema is a language for defining your data store and relationships between data that Oslo uses to define how to handle storage.  My first attempt was to try and replicate the store model of my VideoGameStore data that i've been using to show off Silverlight and ADO.NET Data Services. My original attempt was:

module VideoGameStore
{
    type Product
    {
        ProductId : Integer32 = AutoNumber();
        ProductName : Text where value.Count() < 250;
        Description : Text#250;
        ReleaseDate : Date?;
    } where identity ProductId, unique ProductName;
    
    Products : Product*;
    
    type Game : Product
    {
      Genre : Text#100;
      Developer : Text#150;
      Publisher : Text#150;
    };
    
    Games : Game*;
}

This resulted in the non-decorator table solution of:

Read...