jasperfx / marten Goto Github PK
View Code? Open in Web Editor NEW.NET Transactional Document DB and Event Store on PostgreSQL
Home Page: https://martendb.io
License: MIT License
.NET Transactional Document DB and Event Store on PostgreSQL
Home Page: https://martendb.io
License: MIT License
If you do session.Query().Where(blah blah blah).Select(x => x.Something) it goes pear shaped. You have to do an intermediate ToArray() or ToList() in between.
Think about this and see if anyone really wants projections directly over the top of the document tables. Might temporarily have it fetch and deserialize, then do the projection in memory. Because you know that no one would kill their perf by using that naively.
We already support Contains, so now what about:
Not this minute, but pretty soon get into DocumentSession and start pulling stuff out to smaller, cohesive classes
Worry about this later. Will be smarter later about determining how to get the id type and accessor/funq
Later.
Testing utility to clean out the database between tests
Just a placeholder for now. Have some kind of model that allows you to do transforms to read side views in the database. Might finally get into PLV8 code inside of postgres. I'm thinking that we could do this in lieu of supporting truly crazy LINQ queries of the real model.
Use the Binary COPY feature of npgsql.
This is going to need a lot more thought. What I'd like is a way to define Marten index's in code for common queries that may:
Json.Net options. Aw, Json.Net, how I've missed all your binding conflicts. (Not).
Might be nothing but a test to make sure that it works
See this post. The naive way we're querying today involves runtime casts and can't possibly be efficient.
It's sounding like a big win, but I'm not sure how helpful it would be for deeply nested queries. Not sure how we'd exactly go about switching between using jsonb_to_record/LATERAL and using CASTS instead.
More research necessary.
I used this feature a tiny bit with Raven. It's actually possible w/ Postgresql 9.5 to do partial updates to JSON documents, but I think you'd have to express the change as JSON. Not sure it'd be worth doing a strong typed facade over that, but could be wrong. Maybe use .Net's Dynamic type
Just need a test for it maybe.
Seeing plenty of Any() queries on a child collection in our code at work.
A production time version of IDocumentSchema
that blows up when an unknown document type is encountered. Can't be building new database tables in production in most likelihood anyway.
Laters...
Implement an attribute to identify a Id property as [Identity] with one or more implementations:
Network round trips are evil!
What if we had some way to send several requests up to the db at one time? More research necessary.
Watch this. It does a drop and create table combo regardless today, but that's not going to work in real development.
By default store every class in it's own table, except when on one of the parent classes an attribute [DocumentRoot] is declared.
or always stored subclassed documents into the root class..
So I'm kind of freaked out now that I've seen how many intermediate steps there are between a Linq expression and actually getting the SQL command out of that.
For performance, what if we had a way to express a commonly used query as a Linq statement once and get the SQL string w/ the right parameters built upfront so you can avoid that parsing hit over and over again.
I've got some vague ideas about doing this, but nothing definite yet
Today, it's expecting a where or maybe a where + order by clause and partially building the sql by itself. For the case of needing to exactly fine tune the sql used, support taking in the whole query as well.
I think this mostly means implementing DocumentSession
's IQueryExecutor.ExecuteSingle<T>()
method
Haven't tried something like Where(x => x.User.Name == "foo")
. Look at MartenExpressionParser.JsonLocator()
I think we need some kind of facility to generate the database schema objects for document types. Think about this one more. Is it a console tool on top of the library support? Migrations?
Possible features would be:
Need to add tests and postgres casts in MartenExpressionParser
for:
Will need this sooner or later.
More research on this one.
Don't take this as knocking postgres, which I like in other contexts...but it seems that using something slightly less new (and in use in more projects or companies) would be worthwhile. There's always redis.
I'm curious why documents are being stored with the "json" data type, and not the "jsonb" datatype?
For web app scenarios, when all you wanna do is spit the raw json directly over the outgoing HTTP response, just get the raw json data as a string and spit it out over the wire.
Synchronous and Async. Might investigate some kind of lightweight way to strip out the type information that comes in from Json.Net or whatever the serializer is gonna be.
More work on this later, but assuming that we're going to the OWIN'ified async all the things, Node.js style event loop kind of world for maximum scalability
Flesh out DocumentSession's Load() methods.
Names.Contains("foo")
Implement DocumentSession
's IQueryExecutor.ExecuteScalar<T>(QueryModel queryModel)
method
Maybe use data adapters in ADO.Net to submit all the changes in one batch? May not be that crazy. Another alternative would be to submit a batch of JSON and have a plv8 sproc in the database do the work of pushing the data to the right places.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.