Skip to content

xrado/kohana-mssql

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 

Repository files navigation

Kohana PDO MSSql driver with emulation of LIMIT and OFFSET

requirements

  • MSSql Server 2005 (or newer)
  • php pdo mssql driver
  • freetds

bootstrap.php

Kohana::modules(array(
	...
	'kohana-mssql'   => MODPATH.'kohana-mssql',
	'database'       => MODPATH.'database',
	...
));

(order is important)

config/database.php

return array
(
	'default' => array(
		'type'       => 'mssql',
		'connection' => array(
			/**
			 * The following options are available for PDO:
			 *
			 * string   dsn
			 * string   username
			 * string   password
			 * boolean  persistent
			 * string   identifier
			 */
			'dsn'        => 'dblib:host=hostname;dbname=database',
			'username'   => 'test',
			'password'   => 'test',
			'persistent' => FALSE,
		),
		'table_prefix' => '',
		'charset'      => FALSE,
		'caching'      => FALSE,
		'profiling'    => TRUE,
	),
);

example usage

DB::query(Database::SELECT, 'SELECT * FROM table OFFSET 10 LIMIT 20');
DB::select('*')->from('table')->limit(10)->offset(10)->execute();
ORM::factory('model')->offset(30)->limit(15)->find_all();

About

MsSQL database module for Kohana

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages