create-table


What is the recommended way to create table with PetaPoco (and NPoco)?


Say I need a table that looks like this:
CREATE TABLE Record (
Id INT IDENTITY(1, 1) PRIMARY KEY CLUSTERED,
Guid UNIQUEIDENTIFIER UNIQUE NONCLUSTERED,
Version ROWVERSION,
DateOfBirth DATETIME2,
Name VARCHAR(64) NOT NULL
)
What's the recommended way of creating the table above using PetaPoco and NPoco?
PetaPoco is all about using SQL for what SQL does best. Therefore, the correct way to create a table with PetaPoco is to create it with SQL. We've had a few requests to add schema generation from POCOs, but every supported DB has their own take on DDL, and thus to add it (properly) would be a big undertaking.
It may be added some day, but right now development time is better spent on other features.
That said, PetaPoco is open source, so a PR, if done properly, for schema generation would be happily accepted ;)
Finally, although I don't follow NPoco all the closely, I don't think it has support for schema generation from POCOs, and at a guess, it would be due to the same reason listed above.
I use a migration tool (DbUp) to keep up with the changes in the schema.

Related Links

Create table with constraint in openedge progress
Create table automatically in database backup when I create table from database source
Create Table in Impala use one Table for the Datatype
i cannot create a table , what is the wrong here ? ( Syntax error: Encountered “(” )
What is the recommended way to create table with PetaPoco (and NPoco)?
SQL oracle Developer error
'create table' event … with Apache Cassandra
Creating table in mysql but the error keeps poping up , what am i doing wrong?
How to create table with Simple.Data?
“table or view does not exist” but it does
SQL Error: ORA-00904: : invalid identifier in creating table

Categories

HOME
ibm-bluemix
server
relative-path
onedrive
rsyslog
fsm
in-app-purchase
synchronization
awesome-wm
remote-access
commonmark
phaser
leiningen
uitypeeditor
opentracing
google-static-maps
pugjs
nhibernate-envers
mps
google-search-api
blazemeter
android-widget
fish
underflow
kannel
jspm
gitignore
twilio-api
semantic-versioning
code-contracts
phpfreechat
mozilla
mapdb
dosbox
disassembling
occlusion
sharefile
uft-api
core-plot
glew
dotcover
outlook-2013
parentheses
jquery-nestable
idisposable
google-perftools
boost-preprocessor
color-profile
webdriverjs
vtigercrm
root-framework
deadbolt-2
infix-notation
underscore.js-templating
skobbler-maps
mathematica-frontend
moveit
bluegiga
asp.net5
itextpdf
cloudbees
feedback
fouc
purge
content-length
cakephp-3.1
pretty-print
javax.mail
ng-animate
jscript.net
coldbox
winddk
asp.net-dynamic-data
websocket4net
expected-exception
stxxl
c18
gridfs
listings
dotnetnuke-5
shellexecute
hungarian-algorithm
comaddin
angularjs-controller
quickdialog
cascalog
onsubmit
cufon
boost-filesystem
data-loss
joyent
calling-convention
jquery-ui-droppable
perfect-hash
meego
web-architecture
virtual-functions

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App