schema

How to test the validity of XML against an XML Schema in ActionScript?

I don't need to parse the XML, or to decode it into an ActionScript object -- I'm only interested in loading both XSD and XML and tell whether the latter is legal XML according to the document definition in the former. ...

Using nHibernate to retrieve Database Schema

Is it possible to generate a schema of a database from nHibernate, where I have provided nHibernate with the configuration to the database but I have not written any mappings. I wish to get the Database MetaData/Schema programmatically. I am using an Oracle Database. I have tried two approaches: Approach one: public DatabaseMe...

How to change the schema for a diagram?

Hi, Diagrams created with Microsoft SQL Server Management Studio have their default schema set to dbo. It seems that there is no way to set another schema when creating a diagram. For tables, alter schema NewSchemaName transfer dbo.TableName moves a specified table to the new schema. But the same command does not work for diagrams. ...

SQL Server 2005/2008 - Why is the sys.sysobjects view available to users without the schema name?

I've noticed some strange behavior in SQL Server Express 2008, and I've been trying to track down the cause. When you create a new database, you are able to access the sys.sysobjects view without specifying the schema identifier, as follows: SELECT * FROM [sysobjects] You are able to do this even if your default schema is something ot...

Is there a Java API for comparing Database Schemas

I'd like to compare if tables columns including datatypes and length/precision. indexes and their columns constraints in two database schemas are identical. Is there anything like this available? Maybe from one of the database migration managing tools? ...

Multiple primary keys in a schema

I have this schema which I need to define two primary keys; one is Drupal's 'vid' field and the other one is my site 'bid' field which is of auto increment type which in turn requires it to be a primary key: wtherwise I get MySQL error. I'm having trouble finding syntax for defining multiple primary keys in a Drupal schema. If anyone can...

How to generate a diagram of a very large database schema (SQL Server)

I have a very large database I need to diagram. The database is SQL Server 2008 on x64. It is large in that there are hundreds of related tables, each with up to 2000 fields (some are sparse), multiple relationships between tables (often hundreds per table, in fact), multiple schemas... you get the idea. I tried to use the Database Diag...

What table naming convention is best for ORM

I recently started work at a new shop that uses a table naming convention like the following: Users UserRoles UserUserRoles UserProfiles UserProfileLanguages The convention I've been using is: Users Roles UserRoleMaps Profiles Languages When my boss asked why I don't prefix my tables, I explained that a database diagram would exp...

Is there a XSD Schema of Activity Stream feed?

I am trying to map Activity Stream feed to Java entity beans using JAXB. If there were a XSD schema of ActivityStream, it would be so much easier. Does anyone know if there exists a XSD schema of ActivityStrea.ms? ...

Symfony using Doctrine and MySQL

For schema.yml to work with relations, do you have to InnoDB? Here is my schema: BuybackStatus: connection: doctrine tableName: buyback_statuses columns: id: type: integer(4) fixed: false unsigned: true primary: true autoincrement: true label: type: string() fixed: false unsi...

Database Security Model using Schemas

I'm working on a system at the moment which, for no apparent reason, has been split into no fewer than 7 separate databases so I'm looking to merge everything together. The application is used within the client's company but a restricted version is also exposed to the internet. At the moment, a separate 'internet' version of the databa...

enforce empty JSON schema

I want a JSON schema that enforces an empty JSON instance, e.g. {} Is this a good idea and possible? I tried the following but it allows me to enter anything in the JSON body: { "description": "voice mail record", "type": "object", "additionalProperties": false, "properties": { } } } ...

Roles, Permissions, Objects based access system

I am looking to build a good access control system. I need support for roles, permissions, access objects, etc. I am looking for ideas/existing schema which could guide me to design the system. These are the general basic features. Create users with multiple roles User level fine tuning permissions User access level to prevent users wi...

Attaching simple metadata to a MySQL database

Is there a way to attach a piece of metadata to a MySQL database? I'm trying to write code to automatically update the database schema whenever a code upgrade requires it. This requires the storage of a single integer value -- the schema version. I could of course create a whole table for it, but that seems like overkill for just a simpl...

What's the most elegant way to retrieve a MySQL table comment?

I'm trying to programmatically retrieve the comment for a MySQL table. The first method suggested to me was: $shown = $db->query('show create table ' . TABLE_NAME)->fetch_row(); preg_match("/COMMENT='(.*)'/", $shown[0], $m); $comment = $m[1]; But that kind of workaround makes me cringe. I stumbled upon another way: $result = $db->que...

How does one create a schema for composite types?

I have an XML spec that looks like this: <Root> <Directory Name="SomeName"> <TextFile Name="ExampleDocument.txt>This is the content of my sample text file.</TextFile> <Directory Name="SubDirectory"> <Speech Name="Example Canned Speech"> ... </Speech> </Directory> </D...

postgresql request over several schema

Hello, I have a database, with every users having a schema. Is there a way to query a table in every schema? Something like: select id, name from *.simulation doesn't work... Thank you for your help ! ...

Why groovy sql remove schema name from SQL queries?

I need to execute this query: Select * from my_schema.table_within_schema Unfortunately groogy.sql.SQL is removing my_schema and executing a query without schema information: Select * from table_within_schema I wonder if it is possible to force groovy.sql.Sql to keep a schema name in the query. Groovy: 1.7, Db: I use a jdbc dr...

postgresql stored procedure with query on several schema

Hello, After some answer on a previous question (request over several schema), I try to write a stored procedure to select tables for several schemas (Each user have a schema). create or replace public.select_simulations() returns setof simulation as $$ declare users pg_user%ROWTYPE; simu simulation%ROWTYPE; begin for user...

sqlite - programmatically determine primary key(s)

I need to programatically determine what the primary key field(s) are for a given sqlite table (using sqlite api, not command line). I can get a list of tables and a list of columns, but only see the column type using the Column_Type() function. Need to know if a given column is the primary key (or part of the primary key if a compound...