Giter Club home page Giter Club logo

skele's Introduction

skele

SQL development companion application. Intended to make development of SQL databases easier.

skele's People

Contributors

swhitf avatar

Watchers

James Cloos avatar  avatar

Forkers

tonypires

skele's Issues

Skele breaks during query of metadata if same table/column combination exists in more than one SQl schema

In the method below, if we have the same table/view created in two different schemas, a "An item with the same key has already been added." error will be thrown.

In private static void ApplyColumnData(IDatabaseSession session, List tables) method, change the following code from:

  string sql = session.Build().Query("INFORMATION_SCHEMA.COLUMNS").Select("TABLE_NAME", "COLUMN_NAME", "COLUMN_DEFAULT", "IS_NULLABLE", "DATA_TYPE", "CHARACTER_MAXIMUM_LENGTH").ToSql();
  IDataMapper<ColumnDescriptor> mapper = DataMapperFactory.Create<ColumnDescriptor>((Func<DataMapperFactory.ITranslator, ColumnDescriptor>) (x =>
  {
    string index = x.String("TABLE_NAME");

to

string sql = session.Build().Query("INFORMATION_SCHEMA.COLUMNS").Select("TABLE_SCHEMA" ,"TABLE_NAME", "COLUMN_NAME", "COLUMN_DEFAULT", "IS_NULLABLE", "DATA_TYPE", "CHARACTER_MAXIMUM_LENGTH").ToSql();
IDataMapper mapper = DataMapperFactory.Create((Func<DataMapperFactory.ITranslator, ColumnDescriptor>) (x =>
{
string index = x.String("TABLE_SCHEMA") + x.String("TABLE_NAME");

Error Details:
Fatal Error:
An item with the same key has already been added.
Trace:
at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
at System.Collections.Generic.Dictionary2.Insert(TKey key, TValue value, Boolean add) at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable1 source, Func2 keySelector, Func2 elementSelector, IEqualityCompare

at System.Linq.Enumerable.ToDictionary[TSource,TKey](IEnumerable1 source, Func2 keySelector)
at Skele.Interop.SqlServer.MetadataFactory.ApplyColumnData(IDatabaseSession session, List1 tables) at Skele.Interop.SqlServer.MetadataFactory.Create(IDatabaseSession session) at Skele.Interop.SqlServer.SqlServerSession.Describe() at Skele.Scripting.ExecuteCommandHandler.Execute(ExecuteCommand input) at Skele.Core.DefaultCommandDispatcher.Dispatch[T](T command) at Skele.Core.InputAdapter.CommandTransform1.Apply(String[] input)
at Skele.Core.InputAdapter.Apply(String[] input)
at Skele.Program.Run(String[] args)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.