Git Product home page Git Product logo

amiss's Introduction

๐Ÿ“Ž It looks like you're trying to look at my Github profile

I'm moving to Source Hut, but it'll take me a while. Nearly everything interesting's there now.

Some of my favourite things I made that live on my SourceHut:

  • bmp2cpp: Convert an image into source code representing the bitmap and palette. I.e. the source code actually looks like the image. Mostly silly fun, but extremely useful for very specific tasks.
  • musefuse: Point it at a messy folder full of audio files, get a read-only, mountable FUSE filesystem organised by tag values. Surprisingly useful.
  • termimg: Go port of Stefan Haustein's TerminalImageViewer algorithm, with significant performance improvements. This is more than your standard unicode half-block renderer, it wrings a bit more resolution out of your terminal than you might expect. Not as much as sixel though.
  • cmdy: Tasteful, flexible Go library for implementing CLI programs. There are more popular tools out there, but I miss cmdy terribly every time I'm forced to use cobra.
  • wu2quant: Performant, garbage-collector friendly Go port of Xiaolin Wu's Color Quantizer. Want to make a paletted version of your true colour image? Probably not? Well, just in case you do, this one works well.
  • sortnet: Code generator for sorting networks in Go. These are optimised to sort small groups of values faster than anything else around, takes 15-35% of the time the stdlib takes up to about 16 elements.
  • bumpy: Experiments with BMP, the most underrated image format in the world. Seriously.

amiss's People

Contributors

shabbyrobe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

amiss's Issues

Auto column value support

AutoGuid demonstrates a hacky way to use identity based type handlers to generate values. It would be simpler to provide a dedicated means to generate values when none are present. This could also be used for slugs (i.e. "My Title" becomes "my-title")

Updating join views causes exception

If you have a view that contains a join and an Amiss model that represents it, you can't perform updates because Amiss tries to set every column even if it hasn't changed.

PDOException' with message 'SQLSTATE[HY000]: General error: 1393 Can not modify more than one base table through a join view

This is an unavoidable consequence of Amiss eschewing dirty state tracking for performance, but there may be an API level solution to this problem I'm just not seeing yet.

Array mapper overwrites field name when applying default primary type.

Hi,

I believe there is a small bug with the Array mapper. When using a primary key with a property name different to the DB field name, if you do not specify the field type explicitly, the mapper sets the type to the default primary type. However, in doing this, it does not maintain the overridden property name, which eventually causes the query to fail with something like the following error:

Uncaught exception 'PDOException' with message 'SQLSTATE[42S22]: Column not found: 1054 Unknown column 'id' in 'field list'' in C:\www\play\Amiss\Sql\Manager.php on line 567

I've attached a file that recreates the issue and what I believe is a modified Arrays file that will fix the problem. First time using Github and never used Git so not really sure what the process is for submitting fixes. Will probably have a go soon.

Recreate: http://pastebin.com/yMDEGX8F
Fix: http://pastebin.com/pJePjf9z
Both expire in 1 month.

Cheers
Steve

PS Really like your library, found it very useful for a few projects I'm working on. Thanks.

Extendable Criteria object for building DSLs to find particular entities

Splitting discussion from #14 into separate discussions. Paging @dig412.

I've got something similar that I've been working on for this as well, but it's not ready for prime time. I'll clean it up a bit and post it as a gist some time in the next week or two. It might be interesting to see if we can combine the ideas we've had separately.

Order By support for getRelated

Related objects can be filtered by supplying a Criteria obects to the getRelated method, but ORDER BY clauses appear not to be supported.

The runQuery method in Amiss\Sql\Relator\OneMany assumes that if criteria are supplied then there are only WHERE conditions to satisfy.

Can this be fixed by adding support for the various kinds of criteria in the runQuery method?

Many-to-Many with field/column name mismatch

I'm trying out Amiss as a replacement for an in-house ORM that has reached its end of life, and it's working brilliantly so far.

I've run into a problem with many-to-many relationships when the field name of an entity does not match the column name.

For example:

class Artist
{
    /**
     * @primary
     * @field artistid
     */
    public $id;

    /** @field */
    public $name;

    /**
     * @has.assoc.of Event
     * @has.assoc.via EventArtist
     */
    public $events;
}

class Event
{
    /**
     * @primary
     * @field eventid
     */
    public $id;

    /** @field */
    private $name;

    /** 
     * @has.assoc.of Artist
     * @has.assoc.via EventArtist
     */
    public $artists;
}

I've tried to use the functionality from one-to-one mapping for specifying alternate names (http://k3jw.com/code/amiss/doc/relations.html#one-to-one-relator), but although the annotations are parsed correctly, the join does not work.

class EventArtist
{
    /** @primary */
    public $eventId;

    /** @primary */
    public $artistId;

    /**
     * @has.one.of Event
     * @has.one.on.eventId id
     * @var Amiss\Demo\Event
     */
    public $event;

    /**
     * @has.one.of Artist
     * @has.one.on.artistId id
     * @var Amiss\Demo\Artist
     */
    public $artist;
}

$event = $manager->getById("Event", 1);
$manager->assignRelated($event, "artists");
Exception:
Field id does not exist against relation for Event

I can make this work by giving the Event and Artist classes $eventId and $artistId fields, but I'd like to keep just $id if possible.

Is there a way to do this?

MySQL: Support for DELETE IGNORE

Splitting discussion from #14 into separate discussions. Paging @dig412.

This one I'm not quite so sure about. What errors does DELETE IGNORE ignore? Does it still error out on foreign key constraints? I would be reluctant to add it in if it didn't. Can you please provide more details on the use case?

ChainMapper to allow the use of multiple mappers at once

Splitting discussion from #14 into separate discussions. Paging @dig412.

ChainMapper to allow the use of multiple mappers at once - i.e. a stack that finds the top-most compatible mapper. I have Note at the bottom, and all our CustomMappers at the top.

Definitely want to see this one in there for v5, I have already got a place in my own code where it would be a benefit.

MySQL server has gone away

Splitting discussion from #14 into separate discussions. Paging @dig412.

MySQL dropping the connection after inactivity [...] was biting us in some long-running scripts

This old chestnut! Love to see what you have here, I dread this error.

I've factored out the Connector component into shabbyrobe/pdok. Does this issue belong in that project?

Manager should use primaries of Object attributes when saving

#24 When I try to save an entity having a field related to another table (using the @has.one.of clause) I get an Exception because my object is not a valid type.

Manager should check if the value is an object, and if so if the underlying class has a meta in order to use its primary value.

This in order to avoid painful temporary settings, like:

$temp = $entity->getUser();
$entity->setUser($temp->getId());
$manager->save($entity);
$entity->setUser($temp);

@shabbyrobe do you think this kind of request makes sense ?

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.