Tag Archives: database

(SQL) Rename Microsoft SQL Server Database Schema

Generates a set of queries to run which will change the schema for all items within a specified schema and change them to another.

Posted in Uncategorized | Also tagged , , , | Leave a comment

(C#) LazyLoader – a simple, thread-safe class that can be used to load data on demand

A simple, thread-safe wrapper class for lazy-loading data into an instance on-demand (i.e. when the instance is first accessed.) Usage: LazyLoader l = new LazyLoader(() => Foo.LoadFromDataSource(“DB Connection String”)); // For access to the lazy-loaded instance: var x = l.Instance.Bar; // Need to ensure that the data is loaded deterministically? Use this: l.EnsureLoad();

Posted in C# | Also tagged , , , , , , , , | Leave a comment

Abstract database models with PDO MySQL (Zend Framework)

Zend Framework allows you to create models which extend Zend_Db_Table_Abstract. The snippets below demonstrate abstract database models.

Posted in PHP | Also tagged , , , , , , | 1 Comment